[英]Showing the DirectoryIndex in the URL with Apache
有没有一种方法可以默认显示URL中的DirectoryIndex文件? 例如,如果DirectoryIndex是index.html,则当我输入www.someurl.com时,它将自动显示www.someurl.com/index.html
我认为没有触发Apache自动执行此操作的选项。
但是,如果您知道索引文档,则可以使用mod_rewrite重定向此类请求:
RewriteEngine on
RewriteRule ^/$ /index.html [L,R=301]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.