问题
While our new website is under development we want to allow a small user base to look at the new site and get feedback. Our current site www.sitea.com will remain functional and available but we want them to visit www.sitea.com/v2 and have the browser maintain the url www.sitea.com/v2 but show the contents of the new site www.siteb.com is this possible?
Preferably this would be done with an .htaccess file if possible I am open to other suggestions though.
回答1:
Maybe, you can use ProxyPass for this
This directive allows remote servers to be mapped into the space of the local server.
I haven't used this myself, but something like this might work
<Location "/v2/">
ProxyPass "http://www.siteb.com/"
</Location>
Unfortunately, this cannot be used in a .htaccess file. The Context lists only
Context: server config, virtual host, directory
See the manual for details.
来源:https://stackoverflow.com/questions/32961862/redirect-website-but-maintain-my-url-in-browser-address-bar