views:

12

answers:

1

I've got this:

RewriteEngine On
RewriteRule ^/redir?url=(.*)$ http://blah.$1

When I use this and go to the url that looks like:

http://www.mydomain.com/redir?url=www.otherdomain.com

It says the file isn't found on my server. I.E. no redirect.

What I want it to do in the above example would be to redirect to:

http://blah.www.otherdomain.com

G-Man

+2  A: 

Rewriterules don't work on querystrings, RewriteCond's do:

RewriteCond %{QUERY_STRING} url=([^&]+)(&|$)
RewriteRule ^/?redir$ http://blah.%1
Wrikken