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!

URL redirection without changing the address in the address bar

Discussion in 'General Discussion' started by nitaish, Nov 1, 2007.

  1. nitaish

    nitaish Well-Known Member
    PartnerNOC

    Joined:
    Jan 6, 2006
    Messages:
    134
    Likes Received:
    2
    Trophy Points:
    168
    Location:
    Mulund, India, India
    Hello,

    I want to redirect a website to a particular URL so that the address bar shows the same URL and not the destination URL. I know it is possible via URL masking, however, I want it in such a way that whenever somebody clicks on any link in the website, the address bar should still show the original URL. To put it in simple words,

    Suppose I want to redirect http://www.xyz.com to http://www.abc.com/pqr/index.htm. Now if there is a link named contact/index.htm and somebody clicks on it the address bar should display http://www.xyz.com/contact/index.htm and not redirect to http://www.abc.com/pqr/contact/index.htm.

    How can it be possible using URL Rewrite method in .htaccess file? Can anybody guide me?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,216
    Likes Received:
    10
    Trophy Points:
    313
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    That sounds a lot like using parked domains. However, mod_rewrite is also a very useful tool for situations like this. I usually consult the Apache documentation for mod_rewrite for help with using mod_rewrite.

    Apache 1.3 mod_rewrite docs:
    http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html

    Apache 2.0 mod_rewrite docs:
    http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html

    Apache 2.2 mod_rewrite docs:
    http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
     
  3. nitaish

    nitaish Well-Known Member
    PartnerNOC

    Joined:
    Jan 6, 2006
    Messages:
    134
    Likes Received:
    2
    Trophy Points:
    168
    Location:
    Mulund, India, India
    do you have a working example for this?
     
    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