- Login to cPanel and go to File Manager.
- On the top right side under File Manager, click Settings and check "Show Hidden Files (dotfiles)" and Save.
Note: This must be enabled for you to check the .htaccess which must be edited in order to complete the task. - Go to public_html folder and search for .htaccess file.
- To edit the .htaccess file, press right click on your mouse on index.php file and click Edit and click Edit once the loading process is done.
- Add this code to your .htaccess file.
RewriteCond %{HTTP_HOST} ^DomainA.com
RewriteRule ^(.*) http://DomainB.com/$1 [P] - Click Save to override the current code and save the changes you've made.
- To check if it's working, clear your browser cache and history or use the incognito mode on your browser.
Categories
Categories
How to Redirect a Domain without Changing the URL? Print
- 1
Was this answer helpful?
Related Articles
What is a subdomain?
A subdomain is a subsection of a main domain, in this format:
subdomain.maindomain.com
Sub...
How do I create a subdomain?
Login to cPanel.
Locate and click on the "Subdomains" icon under the "Domains" category....
Enable or disable subdomain redirection
To enable or disable redirection of a subdomain, perform the following steps:
Click...
How to remove a subdomain?
To remove an existing subdomain, perform the following steps:
Click the Remove link...
How to modify a subdomain?
Modify the document root for a subdomain
To modify the document root for a subdomain, perform...