[mdlug] Apache rewrite not working

Carl T. Miller carl at carltm.com
Fri Apr 29 08:52:54 EDT 2011


Michael ORourke wrote:
> Listen  x.x.x.x:80
> <VirtualHost x.x.x.x:80>
>     ServerName www.example.com
>     ServerAlias www.newsite.com
>     RewriteEngine on
>     RewriteCond %{HTTP_HOST} ^example\.com [OR]
>     RewriteCond %(HTTP_HOST) ^www\.newsite\.com [OR]
>     RewriteCond %(HTTP_HOST) ^newsite\.com
>     RewriteRule ^(.*)$ http://www.example.com [R=permanent,L]


I've never seen the [OR] added to a RewriteCond.  Just for
grins, see if this works.

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

c





More information about the mdlug mailing list