views:

123

answers:

1

Right now I have an outdated URL that is getting 404'd:

http://mysite.com/category/?tag=blue-example

It needs to be redirected to:

http://subdomain.mysite.com/blue/

This doesn't work:

Redirect 301 /category/?tag=blue-example http://subdomain.mysite.com/blue/

How do I properly rewrite this URL?

A: 

The mod_alias does only chech the URI path and not the query (the part after the ?). But you can use mod_rewrite for this:

RewriteEngine on
RewriteCond %{QUERY_STRING} =tag=blue-example
RewriteRule ^category/$ http://subdomain.example.com/blue/? [L,R=301]
Gumbo
Thanks Gumbo! This appears to be what I am looking for but for some reason it is not working on my local install. I am using a bunch of other mod_rewrite rules that are working.
m1755