Forum Moderators: phranque

Message Too Old, No Replies

Site cannot be accessed without www. prefix

mysite.com doesnt work, but www.mysite.com does

         

Tware

12:50 pm on Aug 25, 2005 (gmt 0)

10+ Year Member



Hello, this is my first post here.
I have a problem. If I have wildcard DNS turned on on my server (for virtual subdomains), then mysite.com doesn't work anymore, it redirects to the administrator control panel login. Can anyone help me how the site can be accessed without the www prefix? Thanks

kaspar

2:22 pm on Aug 25, 2005 (gmt 0)

10+ Year Member



This line in my httpd.conf file, in a <VirtualHost> container:

ServerAlias *.mydomain.com

takes care of that. I have Wildcard DNS, too.

In the section where I do the URL rewriting to make subdomains work nicely, this one:

RewriteCond %{HTTP_HOST}!^www\.mydomain\.com [NC]

excludes www.mydomain.com from URL rewriting

HTH - it worked for me

kaspar

7:49 pm on Aug 25, 2005 (gmt 0)

10+ Year Member



Another issue could be that your server isn't configured for domain name aliases. A line like:

ServerAlias *.mydomain.com

will often do the trick. Don't forget to restart the Apache
web server so the change will take effect.

Tware

5:47 am on Aug 26, 2005 (gmt 0)

10+ Year Member



Thanks. But there's a problem, i cannot acces the apache server because I have not hosted the website myself. A hostingprovider has hosted it. Is there any chance I can fix it?