I have a VPS with 1 shared IP for multiple sites. For one of my projects (myAwesomeSite.com), i want all my users to:
For case 1, i added an A record to myAwesomeSite.com pointing to my servers IP, and modified httpd.conf adding: "ServerAlias *.myAwesomeSite.com"
Everything seems to work great, any subdomain i try gets redirected to the main site (keeping the url, so i can process it with PHP). ?
For testing case 2, at the same server i have another domain: jhonsExternalSite.com, so i added in the domains DNS config the following CNAME:
It seems to get redirected, because i get the site "Apache is functioning normally", but im not getting myAwesomeSite.com. Am i missing something? both domains are at the same server (sharing IP), but i need to make this work for other domains inside and outside my server. Also it would be great to continue using wildcards so i dont need to create rules for each user.
thanks in advance!
- Have their own subdomain pointing to the main site. example: jhon.myAwesomeSite.com, denise.myAwesomeSite.com
- Have their own external domain pointing to the main site. example: sales.jhonsExternalSite.com, deniseExternalSite.co.uk
For case 1, i added an A record to myAwesomeSite.com pointing to my servers IP, and modified httpd.conf adding: "ServerAlias *.myAwesomeSite.com"
Name | TTL | Type | Value |
* | 3600 | A | 1.2.3.4 |
Everything seems to work great, any subdomain i try gets redirected to the main site (keeping the url, so i can process it with PHP). ?
For testing case 2, at the same server i have another domain: jhonsExternalSite.com, so i added in the domains DNS config the following CNAME:
Name | TTL | Type | Value |
sales.jhonsExternalSite.com. | 3600 | CNAME | jhon.myAwesomeSite.com. |
It seems to get redirected, because i get the site "Apache is functioning normally", but im not getting myAwesomeSite.com. Am i missing something? both domains are at the same server (sharing IP), but i need to make this work for other domains inside and outside my server. Also it would be great to continue using wildcards so i dont need to create rules for each user.
thanks in advance!