0

is this possible to park a subdomain on the main domain without enabling wildcard subdomains?

i want to make a mobile version for my site on a new subdomain but i want using the same code on my main domain

i read about CNAME record but i cant understand that CNAME records could help

i created a CNAME record with name of app for my domain goldshikmall.com

  • 1
    A CNAME record can be used point your sub domain to the same server as your main domain but is not a hard requirement: you can also use A and/or AAAA records for that. – Bob Mar 16 '21 at 08:56
  • 1
    Then the second part is to ensure that the web server running your main website is also capable of correctly handling requests for your sub domain ( for example by installing a valid SSL certificate that includes your sub domain) and ensuring that the correct content will be displayed (possibly by adding the sub domain as a Server Alias to the existing VirtualHost or creating a new one ) - third the content / web applications on your main website may need to configured to work under an additional URL address (can be zero effort or a big change ) – Bob Mar 16 '21 at 08:57

1 Answers1

2

One can use CNAME to point a subdomain to same server as the main domain. That is one part of sharing application code with a subdomain and domain.

In addition to that, at least following things need to be done:

  1. Make sure the webserver has a corresponding virtual host defined for the subdomain and it uses the same path for files as main domain.
  2. Make sure your application understands that it is available via two different domains.
Tero Kilkanen
  • 34,499
  • 3
  • 38
  • 58