1
我將如何改變htaccess的mod_rewrite的兩個查詢字符串參數路徑格式
http://example.com/?sort=top&time=variable
到
http://example.com/top/variable
&time=variable
可能並不總是使用。
我目前的htaccess:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/?showcase/(.*?)/?$ /showcase.php?id=$1 [L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /showcase\.php\?id=([^\&\ ]+)
RewriteRule ^/?showcase\.php$ /showcase/%1? [L,R=301]
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule !.*\.php$ %{REQUEST_FILENAME}.php [QSA,L]
重寫http://example.com/showcase.php?id=int
到http://example.com/showcase/int
。
這是行得通!非常感謝。我真的不能把我的腦袋寫下來,這似乎太複雜了 – frosty