[英]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.