.htaccess - Redirect 301 - why is my old url being appended to my new url causing a 404 error? -


redirect 301 /features/blahblah.php http://www.mysite.com/articles/blahblah1.php 

results in http://www.mysite.com/articles/blahblah1.php?q=features/blahblah.php 404 error page not found.

so doing wrong here

http://httpd.apache.org/docs/2.0/mod/mod_alias.html#redirect documents what's happening.

you want use redirectmatch, like:

redirectmatch ^/features/blahblah.php http://www.mysite.com/articles/blahblah1.php 

if want "permanent" redirect http status 301 (which can desirable seo purposes) rather temporary 302 redirect, instead use:

redirectmatch permanent ^/features/blahblah.php http://www.mysite.com/articles/blahblah1.php 

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -