URL with and without www

Discussion in 'Installation/Configuration' started by bhwong, May 24, 2010.

  1. bhwong

    bhwong New Member

    Hi,

    If I add a site and put my domain as www.domain.com, domain.com will not go to my website but to ISPConfig's "It's works!" page. If I change my domain to domain.com, www.domain.com will not go to my website but to ISPConfig's "It's works!" page.

    So how do I make sure that both domain.com and www.domain.com go to my website instead of ISPConfig's "It's works!" page?
     
  2. BorderAmigos

    BorderAmigos New Member

    In ISPConfig3 > Sites > Web Domain... Domain: yourdomain.com, Auto-Subdomain: www.

    If you want to redirect then with mod_rewrite installed and enabled put one of these in your .htaccess file...

    To direct all www.example.com to example.com
    Code:
    <IfModule mod_rewrite.c>
      RewriteEngine on
      RewriteBase /
      RewriteCond %{HTTP_HOST} ^www\.yourdomain\.com$ [NC]
      RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301]
    </IfModule>
    
    To direct all example.com to www.example.com
    Code:
    <IfModule mod_rewrite.c>
      RewriteEngine on
      RewriteBase /
      RewriteCond %{HTTP_HOST} ^yourdomain\.com$ [NC]
      RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301]
    </IfModule>
    
     
  3. bhwong

    bhwong New Member

    Thanks! It's working. :)
     

Share This Page