0

CNAME based php hostingI have an application that lets users get a *.onemobi.net account (ex. bob.onemobi.net). Now what I would like to do is give the user the option of being able to use their own subdomain to point to their page (ex. bob.hisdomain.com => bob.onemobi.net). I have setup the server and bob.onemobi.net works as expected. I have added a CNAME entry for bob.hisdomain.com => g.onemobi.net (A record on my DNS server) but when I visit bob.hisdomain.com I automatically get redirected to www.onemobi.net. The default behaviour when a site does not exist is to show a page saying "Site does not exist" without any redirections.

I can't seem to be able to figure out what is causing this. I have tried looking around to see what could possibly be causing this but I'm lost as to what to search for. I'm hoping I can get some guidance from this community.

1 Answer 1

0

I think you are missing the ServerAlias directive for the bob.hisdomain.com, it should look something like this;

<VirtualHost *:80>

ServerName bob.onemobi.net
ServerAlias bob.hisdomain.com
...

</VirtualHost>

basically, because apache doesn't recognise the bob.hisdomain.com as explicitly aliased to some NameVirtualHost it falls through to the default *:80 NameVirtualHost which is presumably www.onemobi.net

1
  • Turns out there was a syntax error in my httpd.conf I added ServerAlias * to my vhost and it seems to be working now. Mar 6, 2012 at 7:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .