Jump to content

using www. gives me a different page


elduderino

Recommended Posts

HI,

 

I've created a subdomain of my site using a vitual host...so i now have a site that you can visit by going subdomain.domain.com.....problem is if i put www.subdomain.domain.com i get the servers default page....can anyone tell me why using the www gives me a different page?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/91386-using-www-gives-me-a-different-page/
Share on other sites

i believe this is misconception that www. is recognized as prefix and not a subdomain (if u know what i mean),

 

you will have to create an extra virtual host www.subdomain.domain.com with the exact same details and the other virtualhost.

 

i believe www. is recognized as a subdomain of the domain name (domain.com).

you will have to create an extra virtual host www.subdomain.domain.com with the exact same details and the other virtualhost.

A better way would be to set the ServerAlias direcitive to www.subdomain.domain.com within the virtualhost for subdomain.domain.com

 

<VirtualHost *:80>
    DocumentRoot /path/here/
    ServerName subdomain.domain.com 
    ServerAlias www.subdomain.domain.com 

</VirtualHost>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.