我一直在爭鬥幾個小時,搜索Google和StackOverflow,沒有解決我的問題,希望你們可以幫忙! :-).htaccess爲特定頁面重寫url參數
我有一個頁面,參數如下:profile?userid=123456789
。我想把它改寫成profile/123456789
。這是我的,但現在無處不在這個頁面上的所有鏈接得到/profile/link
。有沒有解決這個問題?在此先感謝,這裏是我的.htaccess代碼。
RewriteEngine on
RewriteCond %{REQUEST_URI} !/profile\.php
RewriteRule ^profile/([^/]*)$ /profile?userid=$1 [L,QSA]
你需要把參數反向 –