Redirect "" to ""

Discussion in 'Install/Configuration' started by Flornet, Jul 21, 2007.

  1. Flornet

    Flornet New Member

    In apache, I used Redirect Permanent in a vhost for "".

    In litespeed, I've set up a listener on WHY does it also work when I connect to ???

    I just want to redirect to ...seems simple :)

    Any help apreciated,

    Florent J.
  2. mistwang

    mistwang LiteSpeed Staff

    A simple redirect rule should do the trick.
    LiteSpeed strip the leading "www." by default.
  3. Flornet

    Flornet New Member

  4. PSS

    PSS Member

    # For sites running on a port other than 80
    RewriteCond %{HTTP_HOST} !^fully\.qualified\.domain\.name [NC]
    RewriteCond %{HTTP_HOST} !^$
    RewriteCond %{SERVER_PORT} !^80$
    RewriteRule ^/(.*){SERVER_PORT}/$1 [L,R]

    # And for a site running on port 80
    RewriteCond %{HTTP_HOST} !^fully\.qualified\.domain\.name [NC]
    RewriteCond %{HTTP_HOST} !^$
    RewriteRule ^/(.*)$1 [L,R]


    And I use this to redirect www to non-www (the way I like it):

    RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]
    RewriteRule ^(.*)$$1 [R=301,L]

    I think rewrites like that should include 301 in order to get robots note the end location only.
    Last edited: Jul 24, 2007
  5. Flornet

    Flornet New Member

    Works great. Many thanks.

Share This Page