Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Domain masking URL

Discussion in 'General Discussion' started by inteldigital, Dec 15, 2018.

Tags:
  1. inteldigital

    inteldigital Well-Known Member

    Joined:
    Apr 5, 2018
    Messages:
    56
    Likes Received:
    9
    Trophy Points:
    8
    Location:
    England
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hi,

    Is there a way I can addon a domain name, and redirect it using masking. I'm trying to achieve the following:

    exampledomain.com has a website on it and isn't hosted locally. I add into my cPanel account, exampledomain2.com and when I click to exampledomain2.com I want to see exampledomain.com website, but the URL bar to say exampledomain2.com.

    How do I achieve this. I know there was a way previously, but can't see it anymore.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. GOT

    GOT Get Proactive! PartnerNOC

    Joined:
    Apr 8, 2003
    Messages:
    1,372
    Likes Received:
    154
    Trophy Points:
    193
    Location:
    Chesapeake, VA
    cPanel Access Level:
    DataCenter Provider
    You can add it as an domain alias and it will behave the way you want, assuming you do not use any rewrites in your code or htaccess that push it back to the primary domain.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Vinayak

    Vinayak Well-Known Member

    Joined:
    Jun 27, 2003
    Messages:
    280
    Likes Received:
    2
    Trophy Points:
    168
    Location:
    Bharat
    cPanel Access Level:
    Root Administrator
    Use .htaccess file to do that, with following code

    Code:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^exampledomain\.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.exampledomain\.com$
    RewriteRule ^/?(.*) http://www.exampledomain2.com/$1 [R=301,L]
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,009
    Likes Received:
    2,123
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice