Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Wed Mar 16, 2011 10:37 am 
Offline
Senior Newbie

Joined: Wed Mar 16, 2011 10:08 am
Posts: 11
i have a domain, say example.com and I host web site using the Apache web server

my website config file (/etc/apache2/sites-available/example.com) looks as follows:
Code:
<VirtualHost example.com:80>
    ServerName example.com
    #ServerAlias www.example.com
    DocumentRoot "/var/www/sites/example.com/current/public"
    ErrorLog "/var/log/apache2/example.com-error_log"
    CustomLog "/var/log/apache2/example.com-access_log" common
    <Directory "/var/www/sites/example.com/current/public">
        Options All
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
    RewriteEngine On
    # Remove the www
    RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
    RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
</VirtualHost>


The website responds to example.com address but doesn't respond to www.example.com

Am I missing something?


Top
   
 Post subject:
PostPosted: Wed Mar 16, 2011 10:47 am 
Offline
Senior Member

Joined: Mon Oct 27, 2008 10:24 am
Posts: 173
Website: http://www.worshiproot.com
The line that would cause it to respond to www.example.com is commented out...


Top
   
 Post subject:
PostPosted: Wed Mar 16, 2011 11:00 am 
Offline
Senior Newbie

Joined: Wed Mar 16, 2011 10:08 am
Posts: 11
JshWright wrote:
The line that would cause it to respond to www.example.com is commented out...


Nope, the server doesn't respond to www.example.com regardless www.example.com (ServerAliase) is commented out or it's not commented out.

Thanks.


Top
   
 Post subject:
PostPosted: Wed Mar 16, 2011 11:11 am 
Offline
Senior Member

Joined: Thu May 21, 2009 3:19 am
Posts: 336
<VirtualHost example.com:80>


Try changing that to

<VirtualHost *:80>


Top
   
 Post subject:
PostPosted: Wed Mar 16, 2011 11:58 am 
Offline
Senior Member

Joined: Wed Mar 03, 2010 2:04 pm
Posts: 111
You might also be missing an A record or CNAME for "www" in your DNS Manager (or wildcard DNS record to catch all subdomains). While I'm a big fan of obfuscating domains in open forums for script/code help, this is one case where having the actual domain would make it a lot easier to figure out the problem.


Top
   
PostPosted: Thu Mar 17, 2011 8:47 am 
Offline
Senior Newbie

Joined: Wed Mar 16, 2011 10:08 am
Posts: 11
My settings seemed to be OK, I just had to clean up browser's cache or just hit Ctrl+F5


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group