Forum Moderators: phranque

Message Too Old, No Replies

Applying Rewrite Rules to root only.

I don't want my doc root rewrite rule to affect sub-directories

         

erikcw

5:28 am on Mar 28, 2004 (gmt 0)

10+ Year Member



I have a ReWrite rule (RewriteRule (.*)\.html$ $1.php) at document root, but I don't want this rule to apply to a sub-directory which is full of .html files (else it returns a 404 error). Any ideas?

jdMorgan

2:46 pm on Mar 30, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Tell it that no more "/" characters are permitted ahead of ".html":

RewriteRule ^([^/]*)\.html$ $1.php

Jim