Parmanent Redirect 301 Problem

New to mod_rewrite? This is a good place to start.

Parmanent Redirect 301 Problem

Postby mehboob » Thu Oct 22, 2009 7:49 pm

Hey Guys,
I am kind of new and there is the situation I am facing..

I used redirect rule to go from to

Code: Select all
RewriteRule ^register$ index.php?act=register [L]

Now the problem is that and other search engines already crawled so they are not crawling the new URL.

How should I setup R=301 in this situation?

I trield
Code: Select all
RewriteRule ^index.php?act=register$ register[R=301]

But no luck in that. Maybe because I am redirecting to a URL that is previously redirected using rewriterule.

Can someone help me out?
Posts: 4
Joined: Wed Oct 14, 2009 6:39 pm

Postby richardk » Fri Oct 23, 2009 9:10 am

Query strings are matched with RewriteConds and the %{QUERY_STRING} variable.
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{QUERY_STRING} ^(.*&)?act=register(&.*)?$ [NC]
RewriteRule ^index\.php$ /register? [R=301,L]

RewriteRule ^register$ /index.php?act=register [QSA,L]
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 7 guests