Redirect multiple domains to one domain (with or without www before)
问题 I have about 18 domains that need to be redirected to a new one. It has to work both with or without www prepended. I've tried this: <IfModule mod_rewrite.c> RewriteEngine on Rewritecond %{HTTP_HOST} !^www\.domain\.com RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L] </IfModule> That gives me a redirect loop (and only works with www before, i think?). 回答1: RewriteEngine on RewriteCond %{HTTP_HOST} ^domain1.com [OR] RewriteCond %{HTTP_HOST} ^domain2.com [OR] RewriteCond %{HTTP_HOST}