views:

43

answers:

1

I have the following two 301 redirects in my .htaccess file. The first redirect /faq.php works fine but the second one just gets a 404 error. Can anyone suggest why this may be happening?

Options +FollowSymLinks
RewriteEngine on

redirect 301 /faq.php   http://www.mysite.com/faqs
redirect 301 /reports/index.php?regionid=14 http://www.mysite.com/forecasts/bay-view
+2  A: 

As the Apache documentation will tell you, mod_alias and Redirect don't support query strings. You'll need to use a RewriteRule:

RewriteCond %{QUERY_STRING} (^|&)regionid=14(&|$)
RewriteRule /reports/index.php http://www.mysite.com/forecasts/bay-view? [R=301]
outis