我的主要问题是我想对访问我的网站的客户隐藏很多目录。
我的基本网址:http : //example.com/qf/development/templates/webApp/
我想为来访的客户隐藏的是这些目录“ / qf / development / templates /”
我已经尝试在Web根目录下http://example.com/.htaccess目录的.htaccess文件中尝试以下操作
这是我的.htaccess文件中的内容,但不起作用。
选项+ FollowSymLinks -MultiViews
RewriteEngine开
RewriteBase /
RewriteRule ^ qf $ qf / development / templates / webApp / index.php
你可以试试这个规则
RewriteEngine on
RewriteBase /
RewriteRule ^qf/?$ qf/development/templates/webApp/index.php [L,NC]
这会将www.example.com/qf重定向到www.example.com/qf/development/templets/webApp/index.php
或者
将以下行添加到您的.htaccess文件中
IndexIgnore *dir
这告诉Apache Web服务器列出除IndexIgnore中的文件以外的所有文件
示例1如果要隐藏名为foo的目录,请在.htaccess文件中添加以下行
IndexIgnore *foo
示例2如果要隐藏以.bar结尾的文件,请将以下行添加到.htaccess文件中
IndexIgnore *.bar
如果要禁用所有文件和目录表单列表,请将此行添加到.htaccess中
IndexIgnore *
通配符“ *”表示将不显示任何文件
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句