This htaccess snippet is supposed to redirect
myhost.com/?p=1&preview=true
to
alt.myhost.com/?p=1&preview=true
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^myhost.com$ [NC]
RewriteRule ^/\?p=([0-9]+)&preview=true$ http://alt.myhost.com/?p=$1&preview=true [NC,R=301,L]
but for some reason I can't escape the / and ? part of the URL. Not sure why this isnt working...
I've tried escaping ?
\\? \? [?]
and I've tried escaping the /
\\/ \/ [/]
none of these seem to work either...
help!
RewriteRuledoes not work with query strings (everything after?) only with url path (which you basically do not have in your example). Are you trying to redirect ALL URLs from one domain to another or just this one? – LazyOne Jun 13 '11 at 18:36