-2

I have some rules as follows:

RewriteCond %{HTTP_HOST} ^domain.com
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=permanent,L]

I would like to make the rewrite condition match ANY domain OTHER than the domain www.domain.com . How can I do this without explicitly make a RewriteCond for each case?

0

1 Answer 1

3

Use a negation

RewriteCond %{HTTP_HOST} !^www\.domain\.com$
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=permanent,L]

Not the answer you're looking for? Browse other questions tagged .