Using .htaccess [removed] without changing URL in

2019-07-01 10:33发布

I currently have a WordPress Multi-Site Network set up. The main website is located at "http://safesideinc.com." Then, there is another sub-domain "http://danielgosek.safesideinc.com."

I want the URL "http://safesideinc.com" to lead to "http://safesideinc.com," and the URL "http://danielgosek.com" to lead to "http://danielgosek.safesideinc.com."

Using a 301 Redirect in .htaccess, I can achieve this. However, I would like it so that entering "http://danielgosek.com" in the URL bar leads to "http://danielgosek.safesideinc.com." WITHOUT CHANGING the URL displayed--in this case, the displayed URL should remain "http://danielgosek.com."

Are there any rules that could help me achieve this?

1条回答
你好瞎i
2楼-- · 2019-07-01 11:03

Not possible, a 301 - Permanent Redirect, is an instruction to the BROWSER that the resource has moved permanently and the BROWSER should re-direct to the provided new URL.

If you don't want the URL to change you either need a Reverse proxy set-up between the two virtual hosts / domains, or if danielgosek.com is just an alias, same IP and served from the same Apache virtual host, you could use an internal rewrite.

查看更多
登录 后发表回答