Redirect Server Alias

Discussion in 'Apache Migration/Compatibility' started by innovot, Sep 15, 2015.

  1. innovot

    innovot Well-Known Member

    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: Apr 21, 2017
  2. NiteWave

    NiteWave Administrator

    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: Apr 21, 2017
  3. innovot

    innovot Well-Known Member

    Thank you NiteWave will give it a try.
     

Share This Page