Jump to content

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>

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.