Forum Moderators: phranque
RewriteCond %{HTTP_USER_AGENT} ^Mozilla/4.*
RewriteCond %{HTTP_USER_AGENT} !^.*MSIE.*
RewriteCond %{REQUEST_URI} !^.*ns_.*\.html
RewriteRule ^(.*\.html)$ ns_$1 [L]
Does anyone know what would need to be changed so that this only happens in the current directory (or for that matter the root directory)? I think it's the last line that needs to be changed, but am afraid if I do something it might screw it up.
Any insight?
-Squared
This should limit the redirect to acting only in your top-level directory.
RewriteCond %{HTTP_USER_AGENT} ^Mozilla/4.*
RewriteCond %{HTTP_USER_AGENT} !^.*MSIE.*
RewriteCond %{REQUEST_URI} !^.*ns_.*\.html
RewriteRule ^([^/]\.html)$ ns_$1 [L]
Take a look at this handy primer on regular expressions [etext.lib.virginia.edu].
Hope this helps,
Jim
<edit>... And welcome to WebmasterWorld! </edit>