Forum Moderators: phranque
RewriteEngine on
RewriteCond %{HTTP_HOST}!^www\.kw1-kw2.com\.com
RewriteRule (.*) [kw1-kw2.com...] [R=permanent,L]
This causes a loop.
Any idea on what I'm doing wrong? Works on domains without '-'s in them.
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.apples-oranges\.com
RewriteRule (.*) http://www.apples-oranges.com/$1 [R=permanent,L]
The only other thing I can think of is that inside square brackets, "-" defines a range of numbers or letters, such as [a-z] or [A-Z] or [0-9]. If mod_rewrite is getting confused, precede the "-" with a "\" to escape it. I have never had to do that unless the "-" was wthin square brackets, though.
Jim