views:

112

answers:

1

I wrote a script to add shtml extension to all requests that don't have it. This is it:

Options +FollowSymlinks
<IfModule mod_rewrite.c>
  RewriteEngine on
     RewriteCond %{REQUEST_URI} htmlTemplates
     RewriteCond %{REQUEST_FILENAME} !\.shtml$
     RewriteRule ^.*/(.*)$ $1.shtml [r,nc]
</IfModule>

I tried it on my local server, which is a virtual location, and it ends up rewriting the url with the system location of the file rather like this:

http://svn1/C%3A/Documents and Settings/vunsal/My Documents/My Dropbox/Workspace/National Grid/Templating/Svn1/site/index.shtml

Can anyone tell me what is wrong with my configuration?

+1  A: 

Try this:

RewriteCond $0 htmlTemplates
RewriteCond $0 !\.shtml$
RewriteRule .* %{REQUEST_URI}.shtml [R=301,L]
Gumbo