-1

I'm configuring my first Apache server with mod_wsgi and it isn't working properly. The script runs fine if the browser navigates to : www.sitename.com, but navigating to sitename.com only displays the document root.

<VirtualHost *:80>
        DocumentRoot /var/www
        ServerName sitename.com
        ServerAlias www.sitename.com
        WSGIScriptAlias / /var/www/sitename.com/site/site.wsgi
</VirtualHost>

Any help much appreciated!

  • Your problem is most likely that you have another VirtualHost definition in the Apache configuration with ServerName set to sitename.com and for that hostname it is using that instead. It is only use the above for www.sitename.com as likely that is the only VirtualHost it is listed in. – Graham Dumpleton May 21 '15 at 00:23

1 Answers1

0

This is not an exact solution to your problem, but a recommendation.

You should only use one domain, with or without www to serve content to your visitors, and then use HTTP 301 redirect to direct users to the real site. This way Google cannot have any issues with possible duplicate content on different domains.

Tero Kilkanen
  • 36,796
  • 3
  • 41
  • 63