How to add a redirect where the original domain appears in the browser’s address bar

samami

Registered
Mar 30, 2022
2
0
1
Italy
cPanel Access Level
Root Administrator
I need to redirect a domain, e.g. fromdomain.com, to a destination domain, e.g. todomain.com, with the original domain's URL ,e.g. appearing in the browser’s address bar.

Quoted from cPanel & WHM Documentation > cPanel >Domains > Redirects:

<<
Note:
To add a redirect where the original domain appears in the browser’s address bar, create a subdomain and redirect it to your chosen domain. You can create a subdomain in cPanel’s Domains interface (cPanel » Home » Domains » Domains).
>>

Please, can someone help me in understanding that statement, and in solving my problem? Can I solve my problem via cPanel without direct editing of .htaccess ?

Thanks
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
15,280
2,434
363
cPanel Access Level
Root Administrator
Hey there! In my experience, this will require direct editing of the .htaccess file as the cPanel tools don't allow these more advanced redirects. We just can't allow for every possible coding option within the interface.

I believe you'll want something similar to this:

Code:
RewriteEngine On
RewriteRule ^(.*)$ http://domain.com/$1 [P]
but there is more discussion on that here: Redirect website but keep the original url in the address bar
 

samami

Registered
Mar 30, 2022
2
0
1
Italy
cPanel Access Level
Root Administrator