开发者

.htaccess rewriting rule

开发者 https://www.devze.com 2022-12-26 04:35 出处:网络
I have a folder within a site that is a seperate web app than the parent. Both are working fine, but when I go to the domain.com/folder/ path, I would like it to forward me to domain.com/folder/index.

I have a folder within a site that is a seperate web app than the parent. Both are working fine, but when I go to the domain.com/folder/ path, I would like it to forward me to domain.com/folder/index.htm for consistency. This is the htaccess rule I was trying, but it wasn't working for me and I am not sure what I did wrong.

RewriteRule ^folder/$ folder/index.htm
RewriteRule ^folder$ folder/index.htm

I tried these rules at the start and end of the rule list to see开发者_运维技巧 if anything was overriding and nothing appears to be.


You don't need Mod Rewrite for this. Instead, use DirectoryIndex:

DirectoryIndex index.htm

Place this file in the root of the folder you want this to apply to (e.g. domain.com/folder/)

0

精彩评论

暂无评论...
验证码 换一张
取 消