httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eugene Lee <list-apa...@fsck.net>
Subject Re: [users@httpd] 301 Redirect maintain query string
Date Mon, 21 Jun 2004 17:33:48 GMT
On Mon, Jun 21, 2004 at 11:43:21AM -0400, John Nichel wrote:
: 
: Porter, Mark wrote:
: >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
: 
: Thanks for the reply Mark.  My rewrite rule looks like this...
: 
: RewriteEngine On
: RewriteCond %{REQUEST_URI} /pages/contact.html(.*)
: RewriteRule .* 
: http://www.deluxegrills.com/customer/help.php?section=contactus&mode=update&$1 
: [R=301]
: 
: But it's not tacking on the query string at the end if I forward to a 
: URL which already has a query string.  Below is a snip from my access 
: log....
: 
: 68.168.226.202 - - [21/Jun/2004:11:41:28 -0400] "GET 
: /pages/contact.html?bob=fred HTTP/1.1" 301 368
: 68.168.226.202 - - [21/Jun/2004:11:41:28 -0400] "GET 
: /customer/help.php?section=contactus&mode=update HTTP/1.1" 200 18187
: 
: What am I doing wrong?

I don't think backreferences (the $1 stuff) works from groupings in the
RewriteCond line.  Why not do something simpler?

	RewriteEngine On
	RewriteRule ^/pages/contact.html\?(.*) http://www.deluxegrills.com/customer/help.php?section=contactus&mode=update&$1


-- 
Eugene Lee

---------------------------------------------------------------------
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