可以說調查名稱是測驗。
填寫表格時,它會重定向到 www.example.com/survey_thank_you.php?survey_name=test
然后將其重寫為www.example.com/test/thank_you并按預期作業。
但是因為這里我們使用 ??? 問題就出現了。如果調查名稱是 test?,它會重定向,但會將其重寫為 www.example.com/test%C3%A4/thank_you(這有效),它應該重寫為www.example.com/test?/thank_you
如果直接訪問www.example.com/test?/thank_you也可以。
訪問:
Options FollowSymLinks
Options -MultiViews
RewriteEngine on
AddCharset UTF-8 .php
AddDefaultCharset utf-8
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{QUERY_STRING} ^survey_name=(.*)/?$
RewriteRule ^survey_thank_you\.php$ /%1/thank_you [R,L,QSD]
RewriteRule ^(.*)/thank_you$ survey_thank_you.php?survey_name=$1 [L,NC,QSA]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(.*)/?$ survey_form.php?survey_name=$1 [L,NC,QSA]
如果我將 (.*) 更改為 ([0-9a-zA-Z] ) 它會重寫它好吧 /test?/thank_you 但隨后我收到錯誤 404。任何建議都非常感謝。
uj5u.com熱心網友回復:
test%C3%A4將是雙重URL 編碼的結果。一級解碼,離開testä。
您可以NE在這個地方使用標志來嘗試避免雙重編碼,https://httpd.apache.org/docs/2.4/rewrite/flags.html#flag_ne
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/447384.html
