How to Redirect a Domain without Changing the URL? Print

  • 1

  1. Login to cPanel and go to File Manager.
  2. 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.

  3. Go to public_html folder and search for .htaccess file.
  4. 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. 
  5. Add this code to your .htaccess file.

    RewriteCond %{HTTP_HOST} ^DomainA.com
    RewriteRule ^(.*) http://DomainB.com/$1 [P]

  6. Click Save to override the current code and save the changes you've made.
  7. To check if it's working, clear your browser cache and history or use the incognito mode on your browser.

Was this answer helpful?

« Back