我正在尝试重定向
http://www.indiegamers.co.uk/post?id=1
到
http://www.indiegamers.co.uk/post/1
这是我正在使用的.htaccess文件,但它没有传递URL字符串
RewriteEngine On
RewriteCond ^/post/([^/]+) /post?id=$1
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php [NC,L]
答案 0 :(得分:0)
Options +Indexes -MultiViews
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^post/(.*)/? post.php?id=$1 [L]
试试这个