[英]How can I redirect example.com to some.site.com/example while still showing example.com as the URL?
[英]How can I redirect URI of type (example.com/?a=100) via htaccess?
我遇到的主要問題是沒有像“ index.php”這樣的文件存在。
我想處理以下類型的請求: example.com/?a=100
我已經嘗試過類似的東西:
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING}% ^\?p=825$
RewriteRule ^$ http://example.com/redirected.html [R=301,L]
但這是行不通的。
您必須刪除? 根據您的%{QUERY_STRING}模式:
嘗試:
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} ^p=825$
RewriteRule ^$ http://example.com/redirected.html? [R=301,L]
目標網址末尾的空問號非常重要,因為它會丟棄原始查詢字符串。
在測試之前,請清除瀏覽器的緩存。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.