简体   繁体   English

如何使此htaccess不重定向或更改URL?

[英]How to make this htaccess not redirect or change the url?

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(.*).addon.com$
RewriteRule ^(.*)$ http://main.net/subfolder/%1.addon.com/$1 [L]

It's the final step for one of my projects. 这是我的一个项目的最后一步。

Your help will be greatly appreciated... 对你的帮助表示感谢...

You can make use of the proxy flag in your rule. 您可以在规则中使用代理标志。 It basically sends your request to mod_proxy for further processing - a 'proxy request'. 它基本上将您的请求发送到mod_proxy进行进一步处理-一个“代理请求”。

RewriteRule ^(.*)$ http://main.net/subfolder/%1.addon.com/$1 [P]

Nore that use of the proxy flag automatically implies the last or L flag, where no further rules will be taken into account as another server is now handling the request. 不用说,使用代理标志会自动暗示lastL标志,因为其他服务器现在正在处理请求,因此不再考虑其他规则。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM