如果你搜索的時候看一下YouTube網站,你會看到有一個URL結果然后方法。
例如:
https://www.youtube.com/results?search_query=s
我的.htaccess檔案代碼:
Options FollowSymLinks
RewriteEngine on
RewriteRule post/(.*)/ index.php?id=$1
RewriteRule post/(.*) index.php?id=$1
例如,我想post/122在該頁面上進行分頁,并且我希望在此處添加方法。
但這就是新問題的開始。因為不再讀取 Get 函式。
網址是測驗!
uj5u.com熱心網友回復:
您將需要QSA重寫規則的標志,然后它將原始查詢字串附加到新的 uri
Options FollowSymLinks
RewriteEngine on
RewriteRule post/(.*)/ index.php?id=$1 [QSA]
RewriteRule post/(.*) index.php?id=$1 [QSA]
見https://httpd.apache.org/docs/2.4/mod/mod_rewrite.html#RewriteRule
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/425151.html
