Map new domain to cPanel sub domain?
I have a cpanel account, with primary domain domain.net, hosting 2 website (having 2 directories website1 and website2). i created the subdomain and redirections.
website1.domain.net -> domain.net/website1
website2.domain.net -> domain.net/website2
I purchase a seperate domain: domain.com and tried to map it on a subdomain mentioned previously websbite2.domain.net.
I configured the DNS mapping for domain.com and created an addondomain in cpanel. The redirection works fine.
My problem is that whenever I type domain.com in a browser it changes the url to domain.net/website2.
Is there a way to do the redirection but keeping the domain unchanged?
Thanks
-
Hi, My problem is that whenever I type domain.com in a browser it changes the url to domain.net/website2.
You may have to do URL masking also. Try the below code in the .htaccess..------------------- ------------------- RewriteCond %{HTTP_HOST} ^domain.com RewriteRule ^(.*) http://domain.net/website2/$1 [P] ------------------- -------------------0 -
i created the subdomain and redirections. website1.domain.net -> domain.net/website1 website2.domain.net -> domain.net/website2
Hello @Tarounen, I recommend disabling the existing redirects, and instead configuring the document roots of those subdomains to the path you'd like them to load the contents from. You can adjust the document root value under Modify a Subdomain in cPanel >> Subdomains. Thank you.0
Please sign in to leave a comment.
Comments
3 comments