The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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:
    123
    Likes Received:
    1
    Trophy Points:
    18
    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?
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    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:
    123
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Mulund, India, India
    do you have a working example for this?
     
Loading...

Share This Page