httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy Kavanagh" <>
Subject [users@httpd] Removing an extra slash from redirected URLs
Date Sun, 22 Feb 2004 20:42:34 GMT
Hello all.

I have just converted all of the pages on my website from .shtml to .php
pages, but wish to use .htaccess to redirect requests for the .shtmls over
the .phps.  I currently have this:

RewriteEngine on
RewriteBase   /  
RewriteRule   ^(.*)\.shtml$              $1      [C,E=WasHTM:yes]
RewriteCond   %{REQUEST_FILENAME}.php -f
RewriteRule   ^(.*)$ $1.php                   [S=1,R]
RewriteCond   %{ENV:WasHTM}            ^yes$
RewriteRule   ^(.*)$ $1.shtml

Which works well.  However, when a request for, say: comes in, it is redirected to:

Note the two slashes between com and pages.  Although this works in the
browsers I have tried, it is not an ideal solution.  Does anyone know what I
could do to fix it?  To be honest, RewriteRule and Cond are both a bit over
head and it took ages to get it working as it is - some edited c&p'd code
afraid :)

Can't find anything on the web or on usenet.


Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
Version: 6.0.592 / Virus Database: 375 - Release Date: 18/02/2004

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message