Dropping Query String on Redirect

This is a discussion on Dropping Query String on Redirect within the Apache Web Server forums, part of the Web Server and Related Forums category; I have the following in my .htaccess RewriteCond %{QUERY_STRING} ^rss=1$ RewriteRule ^(.*)$ http://feeds.feedburner.com/Ruminate/rss [R,L] ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-08-2006
Chris Lott
 
Posts: n/a
Default Dropping Query String on Redirect

I have the following in my .htaccess

RewriteCond %{QUERY_STRING} ^rss=1$
RewriteRule ^(.*)$ http://feeds.feedburner.com/Ruminate/rss [R,L]
RewriteCond %{QUERY_STRING} ^atom=1$
RewriteRule ^(.*)$ http://feeds.feedburner.com/Ruminate/atom [R,L]

It works, in that it redirects from
mysite.com/?rss=1
to
http://feeds.feedburner.com/Ruminate/rss?rss=1

But I'd like it NOT to append that query string and just redirect to:
http://feeds.feedburner.com/Ruminate/rss

(that seems like what it should do anyway)... so what's the fix?

  #2 (permalink)  
Old 01-09-2006
Robert Ionescu
 
Posts: n/a
Default Re: Dropping Query String on Redirect

Chris Lott wrote:
> I have the following in my .htaccess

[...]
> But I'd like it NOT to append that query string and just redirect to:
> http://feeds.feedburner.com/Ruminate/rss
>
> (that seems like what it should do anyway)... so what's the fix?


Add a question mark

RewriteCond %{QUERY_STRING} ^rss=1$
RewriteRule ^(.*) http://feeds.feedburner.com/Ruminate/rss? [R,L]
RewriteCond %{QUERY_STRING} ^atom=1$
RewriteRule ^(.*) http://feeds.feedburner.com/Ruminate/atom? [R,L]

Consider also a 301 redirect instead of a 302.

--
Robert
  #3 (permalink)  
Old 01-10-2006
Chris Lott
 
Posts: n/a
Default Re: Dropping Query String on Redirect

Thanks... sorry for the multiple posts-- Google Groups held the
messages for a day so I thought they would never get posted!

c

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:01 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0