0
我正在嘗試以下操作。嘗試了很多方法,但似乎沒有任何工作,如果任何人有任何想法,請幫助。在apache2.2中使用Location指令
<Location /MyRoot>
# '/MyRoot' Should only be allowed, and NONE of its sub should be allowed
# Requests will be redirected to weblogic
</Location>
<Location /MyRoot/MySub1>
# '/MyRoot/MySub1' Should be allowed, and all its sub domains should be allowed
# Requests will be redirected to weblogic
</Location>
<Location /MyRoot/MySub2>
# '/MyRoot/MySub1' Should be allowed, and all its sub domains should be allowed
# Requests will be redirected to weblogic
</Location>
什麼我期待着低於
http://host:port/MyRoot/ --- Should be accessible
http://host:port/MyRoot/MySub1 --- Should be accessible
http://host:port/MyRoot/MySub2 --- Should be accessible
http://host:port/MyRoot/MySub1/MySubSub1 --- Should be accessible
http://host:port/MyRoot/MySub1/MySubSub2 --- Should be accessible
http://host:port/MyRoot/MySub2/MySubSub1 --- Should be accessible
http://host:port/MyRoot/MySub2/MySubSub2 --- Should be accessible
http://host:port/MyRoot/MySub1/MySubSub1 --- Should be accessible
http://host:port/MyRoot/MySub1/MySubSub2 --- Should be accessible
http://host:port/MyRoot/ABC --- Should NOT be accessible
http://host:port/MyRoot/XYZ/LKJ --- Should NOT be accessible
,並有可能是下MyRoot很多文件夾,我想他們是不同的(MySub1 &畝)
任何人都可以請指教在遙不可及如何實現這一點。
謝謝你的迴應,但我不認爲我真的可以使用.htaccess,因爲這些文件夾是從AppServer和Apache服務的,我沒有訪問這些文件夾。所以我不認爲我可以使用'全部拒絕' –