httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Porter, Mark" <Mark.Por...@LibertyMutual.com>
Subject RE: [users@httpd] 301 Redirect maintain query string
Date Mon, 21 Jun 2004 14:41:02 GMT
Hi John,

You should be able to use a rewrite rule:

RewriteEngine On
RewriteCond %{REQUEST_URI} /blah/page.html(.*)
RewriteRule .* http://new/page.php$1 [R]

Mark


-----Original Message-----
From: John Nichel [mailto:john@kegworks.com] 
Sent: Monday, June 21, 2004 10:07 AM
To: Apache List
Subject: [users@httpd] 301 Redirect maintain query string


Hi,

   I am trying to do a 301 redirect for some old static pages which are 
now done in php.  Sometimes, links from other sites will contain a query 
string (eg. http://blah/blah/page.html?foo=bar).  I need to be able to 
include that query string in the redirect if it exists, but I can't seem 
to figure this out.  In a .htaccess file, I have this...

RedirectMatch 301 /blah/page.html(.*)$ http://new/page.php?$1

And the 301 will send page.html to the new page.php, but it's not 
including the query string.  How can I make this work?  TIA.

-- 
John C. Nichel
KegWorks.com
716.856.9675
john@kegworks.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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


Mime
View raw message