URL redirection without changing the address in the address bar

nitaish

Well-Known Member
PartnerNOC
Jan 6, 2006
137
3
168
Mulund, 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?
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
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?
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