Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 81858 invoked from network); 22 Feb 2004 20:42:55 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 22 Feb 2004 20:42:55 -0000 Received: (qmail 26033 invoked by uid 500); 22 Feb 2004 20:42:30 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 26019 invoked by uid 500); 22 Feb 2004 20:42:30 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 26004 invoked from network); 22 Feb 2004 20:42:29 -0000 Received: from unknown (HELO mta04-svc.ntlworld.com) (62.253.162.44) by daedalus.apache.org with SMTP; 22 Feb 2004 20:42:29 -0000 Received: from cheese ([81.100.210.205]) by mta04-svc.ntlworld.com (InterMail vM.4.01.03.37 201-229-121-137-20020806) with ESMTP id <20040222204222.DFVO20489.mta04-svc.ntlworld.com@cheese> for ; Sun, 22 Feb 2004 20:42:22 +0000 From: "Andy Kavanagh" To: Date: Sun, 22 Feb 2004 20:42:34 -0000 Message-ID: <000201c3f984$66cee420$0301a8c0@cheese> MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4510 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Subject: [users@httpd] Removing an extra slash from redirected URLs X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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 to the .phps. I currently have this: RewriteEngine on RewriteBase / =20 RewriteRule ^(.*)\.shtml$ $1 [C,E=3DWasHTM:yes] RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^(.*)$ $1.php [S=3D1,R] RewriteCond %{ENV:WasHTM} ^yes$ RewriteRule ^(.*)$ $1.shtml Which works well. However, when a request for, say: http://www.mydomain.com/pages/index.shtml comes in, it is redirected to: http://www.mydomain.com//pages/index.php 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 my head and it took ages to get it working as it is - some edited c&p'd = code I'm afraid :) Can't find anything on the web or on usenet. Thanks, Andy --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.592 / Virus Database: 375 - Release Date: 18/02/2004 =20 --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org