我搜索了這個問題,但只遇到了我無法滿足我的要求的非常具體的答案。
我的 URL 現在看起來像這樣:https://example.eu/?action=changepassword我希望它看起來像這樣:https://example.eu/changepassword這樣文本?action=就會被洗掉。
我試圖適應這一點,但沒有奏效。
uj5u.com熱心網友回復:
使用您顯示的示例,請嘗試遵循 htaccess 規則檔案。在測驗您的 URL 之前,請確保清除瀏覽器快取。
RewriteEngine ON
##External redirect rules here....
RewriteCond %{THE_REQUEST} \s/?\?action=(\S )\s [NC]
RewriteRule ^ %1? [R=301,L]
##Internal rewrite rules to handle query string in backend.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /?action=$1 [L]
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/335823.html
上一篇:Angular:如何從httpClient請求中獲取引數并用于回圈相同的請求
下一篇:Angular12物件在document.getElementById(elementId)中可能為“null”
