How to make sure domain.tld is always www.domain.tld

Discussion in 'Apache' started by GTech, Jan 23, 2006.

  1. #1
    GTech, Jan 23, 2006 IP
    Will.Spencer likes this.
  2. PedstersPlanet

    PedstersPlanet Peon

    Messages:
    195
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    try:
    However, my sub-domain configuration is different to the usual, so this might not work onsome configurations
     
    PedstersPlanet, Jan 25, 2006 IP
  3. wasabi

    wasabi Guest

    Messages:
    58
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Here is mine :
    
    RewriteCond %{HTTP_HOST} !www.domain.tld$
    RewriteRule (.*) http://www.domain.tld/$1 [QSA,NC,L,R=301]
    
    Code (markup):
     
    wasabi, Jan 27, 2006 IP