Kevin
Kevin

Reputation: 13226

.htaccess rewriting rule

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.

Upvotes: 0

Views: 153

Answers (1)

Danten
Danten

Reputation: 588

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/)

Upvotes: 3

Related Questions