我想使用.htaccess禁用目录列表。
我不想显示任何404 not found
或403 forbidden
错误消息。
假设当用户尝试访问目录时www.mydomain.com/data/uploads
,只有自定义消息将显示为Hi, this is not a page you are looking for
。
有谁能够帮我?
您可以在.htaccess中使用以下代码:
# disable directory listing
Options -Indexes
# show a custom message
ErrorDocument 403 "Hi, this is not a page you are looking for"
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句