0
我需要知道如何創建如下因素的規則在同一個.htaccess文件:的Apache的.htaccess文件夾重定向規則
- 重定向從
example.com/st
到example.com
- 從
example.com/[ANY STRING]
重定向到new-example.com/[ANY STRING]
問題是我需要按原樣發送查詢字符串。
我需要知道如何創建如下因素的規則在同一個.htaccess文件:的Apache的.htaccess文件夾重定向規則
example.com/st
到example.com
example.com/[ANY STRING]
重定向到new-example.com/[ANY STRING]
問題是我需要按原樣發送查詢字符串。
你的問題不是很清楚,但你可以在你的.htaccess文件試試這個代碼:
Options +FollowSymLinks -MultiViews
RewriteEngine on
# your first requirement
RewriteRule ^st/?$/[L]
# your second requirement; it will also append existing query string
RewriteCond %{HTTP_HOST} ^(www\.)?example\.com$ [NC]
RewriteRule^http://new-example.com%{REQUEST_URI} [L,R=301]