0

I have been looking for an answer this without any luck (searched everywhere)

Basically, I want to rewrite a page (subfolder) to a new domain without changing the url.

I've tried with no luck:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/test/
RewriteRule ^(.*) http://newdomain/$1 [P] 

I have had a look at the "duplicate" question and it doesn't answer.

It does not explain how to rewrite a page to a new domain without changing the url.

Froggiz
  • 3,083
  • 1
  • 21
  • 30

2 Answers2

1

Proxy Pass might be what you are looking for. It will use the url that they connected to, and act as a proxy to the new url. They will still see the old url.

ProxyVia on
ProxyRequests Off
ProxyPreserveHost Off

ProxyPass /test http://newdomain/test
ProxyPassReverse /test http://newdomain/test
grag42
  • 431
  • 2
  • 5
0

RewriteEngine On RewriteBase / RewriteRule ^test/(.*)$ http://newdomain/$1 [P,L]

the above rule will redirect all /test/... to backend without modifying the browser URL