[英]Htaccess Redirect : convert subdomain to part of a url
例如,我的域名是www.mydomain.com,並且我有子域名,例如subdomain.mydomain.com/action?qs1=1
現在,我已將以前的子域URL更改為www.mydomain.com/subdomain/action?qs1=1
請讓我知道如何在htaccess中編寫規則以重定向
subdomain.mydomain.com/action?qs1=1
至
www.mydomain.com/subdomain/action?qs1=1
謝謝
這應該工作:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^((?!www).+)\.example.com$
RewriteCond %{THE_REQUEST} /action/\?qs1=1 [NC]
RewriteRule ^ http://www.example.com/subdomain/action/ [NC,L,R]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.