.htaccess - How do i redirect a domain while displaying the old address? -
i've generated .htaccess file using host service 301 permanent redirect empty subdomain new subdomain page in folder.
sejur-avion.old-domain.com
--> subdomain.new-domain.com/agent/5049/sejur-avion
rewriteengine on rewritecond %{http_host} ^sejur\-avion\.old\-domain\.com$ [or] rewritecond %{http_host} ^www\.sejur\-avion\.old\-domain\.com$ rewriterule ^(.*)$ "http\:\/\/subdomain\.new\-domain\.com\/agent\/5049\/sejur\-avion\/$1" [r=301,l]
what need hide "new-domain" name address bar, , if possible display old domain's name instead.
so need subdomain.new-domain.com/agent/5049/sejur-avion
display subdomain.old-domain.com/agent/5049/sejur-avion
i've heard there's serveralias function can use that? please help
you can use mod rewrite's p
flag sends request reverse proxied via mod_proxy:
rewriteengine on rewritecond %{http_host} ^sejur\-avion\.old\-domain\.com$ [or] rewritecond %{http_host} ^www\.sejur\-avion\.old\-domain\.com$ rewriterule ^(.*)$ "http\:\/\/subdomain\.new\-domain\.com\/agent\/5049\/sejur\-avion\/$1" [p,l]
(essentially replacing r=301
p
)
this, however, requires have mod_proxy loaded, isn't case. if module isn't loaded, you're unlikely error (just nothing happens).