我試圖在網站中遵循很多答案,但沒有成功。 我試圖改寫:htaccess重寫規則,使用unicode字母的參數
domain.com/articles/<author>
要:
domain.com/articles/index.php?author=<author>
我現在的原則是:
RewriteRule ^(\w*)$ /articles/index.php?author=$1 [B]
與字母或數字作品,但不使用Unicode charachters像א和「。
對於א,我收到以下錯誤:
Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 404
localhost Apache/2.4.23 (Win32) OpenSSL/1.0.2h PHP/7.0.9
而對於「:
Access forbidden!
You don't have permission to access the requested object. It is either read-protected or not readable by the server.
If you think this is a server error, please contact the webmaster.
Error 403
localhost Apache/2.4.23 (Win32) OpenSSL/1.0.2h PHP/7.0.9
,我需要他們。
編輯:
閱讀@ user82217評論我又試了之後正則表達式,這一次結束標誌是這樣的(*):
RewriteRule (.*) /articles/index.php?author=$1 [END]
現在א此案正在解釋得很好。但是「情況下仍然給出了同樣的錯誤(禁止訪問)
@ user82217曾建議調查日誌中。」情況下,日誌:
Cannot map GET /articles/%22 HTTP/1.1 to file
結論:
作爲@ user82217在評論中說,看來,在Windows操作系統的地址與「字符被認爲是一個非法的文件服務,雖然地址不是一個fi樂此不疲。 所以我放棄了「情況現在。會高興聽到,如果有一種方式來獲得解決的。
你必須如此具體,你可以匹配_everything_即ie。 '(*)'? – MrWhite
@ user82217:我試過了。然後我得到:「內部服務器錯誤」。 – Dorad
只是測試了這種情況。它可以工作,但只能在虛擬主機非目錄上下文中使用。把你的規則放在''裏面,你會得到所有的unicode和雙引號。 –
Deadooshka