views:

64

answers:

1

I'm trying to use mod_rewrite to redirect URLs and can't get anything to work. Here is what I'm hoping to do:

Old URL:

http://www.example.com/asp.pl?%5Fpuri=astore.amazon.com%2Fthegi02-20%2Fdetail%2FB0001L0DFA%2Fassid

Needs to redirect to:

www.example.com

Anyone know of any way to do that?

A: 

Redirect and all the other Redirect* directives do only work with the URL path. So you cannot test the query.

But with mod_rewrite you can:

RewriteEngine on
RewriteCond %{QUERY_STRING} ^_puri=astore.amazon.com&thegi02-20&detail&B0001L0DFA&assid$
RewriteRule ^asp\.pl$ http://www.example.com/ [L,R=301]
Gumbo