![](/img/trans.png)
[英]Ubuntu - How direct example.com/opencart/index.php to http://example.com/ and www.example.com?
[英]How to rewrite the url from www.example.com/index.php?store=test to test.example.com or www.test.example.com in .htacess
我需要将网址从www.example.com/index.php?store=test重写为test.example.com或www.test.example.com
任何人都可以建议我如何在.htaccess文件中实现重写代码。
提前致谢。
尝试将以下内容添加到/root/.htaccess:
RewriteEngine on
#--Redirect from "www.example.com/index.php?store=test"--#
RewriteCond %{HTTP_HOST} ^(www\.)?example\.com$
RewriteCond %{THE_REQUEST} /index\.php\?store=test [NC]
#--to "store.example.com"--#
RewriteRule ^ http://store.example.com [L,R]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.