您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

关于PHP伪静态的有关问题

2024/5/6 6:41:57发布25次查看
关于php伪静态的问题!
我的.htaccess 这么写:
rewriteengine on 
rewriterule ([a-za-z]{1,})-([0-9]{1,}).html$index.php?action=$1&id=$2
程序代码:
现在在浏览器中输入:
localhost/page-18.html
但是报错:
internal server error
the server encountered an internal error or misconfiguration and was unable to complete your request.
please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
请问怎么解决?
------解决方案--------------------
rewriterule ([a-za-z]{1,})-([0-9]{1,}).html$index.php?action=$1&id=$2
index.php前应该有空格
------解决方案--------------------
这有啥为什么啊,
rewriterule要有原来的url和转去的url,你没空格,apache分不清啊,只好发疯500了
------解决方案--------------------
.htaccess就是apache的功能,不修改.conf不能生效, 不过现在大部分地方都是缺省就启用它
如果你是问能否在php里实现url分析及路由,print_r你的$_server, 里面有几个变量包含
完整的url,你可以自己写代码分析然后执行不同的代码
一些开源软件里都有相应的实现,可以参考
探讨
如果不修改apache ,还可以实现这个功能吗?
------解决方案--------------------
探讨
如果不修改apache ,还可以实现这个功能吗?
我的异常网推荐解决方案:the server encountered an internal error () that prevented it from fulfilling this request.,http://www.myexception.cn/java-web/317.html
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product