I added CNAME and configured virtual host perfectly, but sub domain not working, please help me anyone…

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hello,

If this is going to be a separate website, I would recommend adding an A record for your subdomain name rather than CNAME. That way if the A record for your main domain changes, it would not affect your subdomain.

Also, note that it could take between 1 and 72 hours for the DNS cache to clear over the Globe before you could see your new DNS records.

If you are still experiencing the issue, you could share your Vhost here and I could try to advise you further.

Regards,
Bobby

  • I am also used A record but no use, this is my vhost

    <VirtualHost *:80>
    ServerAdmin webmaster@localhost

        ServerName shop.baddhi.com
        ServerAlias www.shop.baddhi.com
    
        DocumentRoot /var/www/shop.baddhi.com
    
        <Directory /var/www/shop.baddhi.com/>
            Options FollowSymLinks
            AllowOverride All
            Require all granted
        </Directory>
    
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
    

    </VirtualHost>

Submit an Answer