Page 1 of 1

mod_rewrite is blocking 301 redirect.

Posted: Sat Feb 28, 2009 1:03 am
by sercotec
Hi,

I am using mod rewrite for Seo


everything works fine with this code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA]

But and its a great but;

when i try to redirect my old pages with this command in .htaccess;

ie: i have a page www.sercotec.net/index.asp which will redirect to www.sercotec.net/index.php

and using this rule below:
Redirect 301 /index.asp http://www.sercotec.net/index.php

and i am getting this result:

http://www.sercotec.net/index.php?page=index.asp

which shows nothing.

If i disable mod rewrite and use pretty urls redirect works.

your help will be appreciated,

thank you in advance...

Re: mod_rewrite is blocking 301 redirect.

Posted: Sat Feb 28, 2009 3:07 am
by viebig
use rewriterule instead

example:
rewriterule index.asp http://www.domain.com/$1 [r=301,l]

Re: mod_rewrite is blocking 301 redirect.

Posted: Sat Feb 28, 2009 9:58 am
by sercotec
No it is not working at all

Re: mod_rewrite is blocking 301 redirect.

Posted: Fri Mar 06, 2009 5:54 pm
by Pierre M.
viebig wrote: use rewriterule instead

example:
rewriterule index.asp http://www.domain.com/$1 [r=301,l]
...at the beginning of the .htaccess just after the right rewrite base.

Re: mod_rewrite is blocking 301 redirect.

Posted: Wed Apr 08, 2009 1:43 pm
by Lucaz