0

任何人都可以帮我重写上面的链接,我制作了自定义脚本,但现在重写这个有问题,我用这样的东西启动 htaccess ......

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^([^/]*)$ /index.php?page=$1 [L]
RewriteRule ^([^/]*)$ /index.php?query=$1 [L]
RewriteRule ^([^/]*)/([^/]*)$ /index.php?query=$1&page=$2 [L]

但这不起作用,我有服务器错误 500 ...

这是我需要重写的..

http://site.com/index.php?page=1 ==> http://site.com/1
http://site.com/index.php?type=news&page=1 ==> http://site.com/news/1
http://site.com/index.php?query=searching ==> http://site.com/searching 
http://site.com/index.php?query=searching&page=1  ==> http://site.com/searching/1
4

1 回答 1

0

试试这些——我认为你有从前的规则:

http://site.com/1执行http://site.com/index.php?page=1

RewriteRule ^([0-9]+) /index.php?page=$1 [L]

http://site.com/news/1执行http://site.com/index.php?type=news&page=1

RewriteRule ^news/([0-9]+) /index.php?type=news&page=$1 [L]

http://site.com/searching执行http://site.com/index.php?query=searching

RewriteRule ^searching/?$ /index.php?query=searching [L]

http://site.com/searching/1执行http://site.com/index.php?query=searching&page=1

RewriteRule ^searching/([0-9]+)$ /index.php?query=searching&page=$1 [L]
于 2012-05-20T07:00:36.777 回答