为什么此URL重写不通过URL字符串?

时间:2013-09-06 08:48:28

标签: php .htaccess url

我正在尝试重定向

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]

1 个答案:

答案 0 :(得分:0)

Options +Indexes  -MultiViews
RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^post/(.*)/? post.php?id=$1   [L] 

试试这个