.htaccess htaccess,url重写

.htaccess htaccess,url重写,.htaccess,.htaccess,任何人都可以帮我重写上面的链接,我做了自定义脚本,但现在有问题重写这个,我开始htaccess与这样的东西 RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^([^/]*)$ /index.php?page=$1 [L] RewriteRule ^([^/]*)$ /index.php?query=$1 [

任何人都可以帮我重写上面的链接,我做了自定义脚本,但现在有问题重写这个,我开始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

试试这些-我认为你有规则:

执行

执行

执行

执行


如果您有500,则需要查看服务器的错误日志以找出错误。我在共享主机上没有权限检查此日志您的共享主机没有在您自己的空间中放置错误日志,仅限于您自己的虚拟主机?是的,对于500个错误,我没有创建任何日志,但我认为这不是服务器故障,我认为这里的问题是
RewriteRule^([^/]*)$/index.php?page=$1[L]
RewriteRule^([^/]*)$/index.php?query=$1[L]
RewriteRule ^([0-9]+) /index.php?page=$1 [L]
RewriteRule ^news/([0-9]+) /index.php?type=news&page=$1 [L]
RewriteRule ^searching/?$ /index.php?query=searching [L]
RewriteRule ^searching/([0-9]+)$ /index.php?query=searching&page=$1 [L]