[英]How to redirect www.domain.com/subfolder/ to www.domain.com/subfolder/blog.html using htaccess
How to redirect www.domain.com/subfolder/
to www.domain.com/subfolder/blog.html
, because I cannot have index.html. 如何将www.domain.com/subfolder/
重定向到www.domain.com/subfolder/blog.html
,因为我无法使用index.html。 So that's why I am asking this question. 所以这就是为什么我问这个问题。
Try : 尝试:
RedirectMatch ^/subfolder/?$ http://www.domain.com/subfolder/blog.html
This will redirect /subfolder/
to http://www.domain.com/subfolder/blog.html
. 这会将/subfolder/
重定向到http://www.domain.com/subfolder/blog.html
。
创建一个文件/subfolder/.htaccess
如果不存在),并在顶部添加以下行:
DirectoryIndex blog.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.