Forum Moderators: phranque

Message Too Old, No Replies

301 redirect not leaving out url parameters

         

SEOViking

8:40 am on Oct 17, 2005 (gmt 0)

10+ Year Member



I have the following in my .htaccess file:
RewriteEngine On

RewriteRule ^forum.*$ http://www.example.com [R=301,L]

but when i follow a link that has the form forum/index.asp?topic-id=3

then i end up here:
http://www.example.com/?topic-id=3

i just want the redirect to go to http://www.example.com, with no parameters.

any suggestions?

dcrombie

10:31 am on Oct 17, 2005 (gmt 0)



Try this:

RewriteRule ^forum /? [R=301,L]

;)

SEOViking

10:48 am on Oct 17, 2005 (gmt 0)

10+ Year Member



i should have been more clear, sorry.
i want [example1.com...] to be forwarded/moved permanently (301) to the root of http://www.example.com (a different site)

dcrombie

11:00 am on Oct 17, 2005 (gmt 0)



RewriteRule ^forum http://www.example.com/? [R=301,L]

SEOViking

11:04 am on Oct 17, 2005 (gmt 0)

10+ Year Member



thanks dcrombie, it worked. why the '?' at the end? that seems crazy. can you explain? thanks again.

dcrombie

11:20 am on Oct 17, 2005 (gmt 0)



The '?' represents an empty query string.