Redirect Server Alias

innovot

Well-Known Member
#1
Hello:

on our Apache installation we have been using:

Code:
    RewriteEngine On
    RewriteCond %{HTTP_HOST}  !^www.somesite.com [nocase]
    RewriteRule ^(.*)$        http://www.somesite.com$1 [last,redirect=301]
so that any ServerAlias would be redirected to the primary site. Under LiteSpeed this does not appear to be working and not sure how to fix it.

Any help would be appreciated please.
 
Last edited by a moderator:

NiteWave

Administrator
#2
Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.somesite.com [nocase]
RewriteRule ^(.*)$ http://www.somesite.com$1 [last,redirect=301]
can you try following
Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.somesite.com$ [NC]
RewriteRule ^(.*)$ http://www.somesite.com/$1 [L,R=301]
it should work.
 
Last edited by a moderator:
Top