http://www.15597.com/index.php/module/xxx/actio">
当前位置:Gxlcms > PHP教程 > 怎样利用好PATH_INFO方式隐藏index.php文件?

怎样利用好PATH_INFO方式隐藏index.php文件?

时间:2021-07-01 10:21:17 帮助过:17人阅读

我在用php程序建站时喜欢用PATH_INFO的方式来实现搜索引擎友好,比如:

php/module/xxx/action/xxx/id/xxx">http://www.15597.com/index.php/module/xxx/action/xxx/id/xxx

但是index.php能看到扩展名.php很不爽,解决方法如下:

在APACHE中这样配置:

ForceType application/x-httpd-php

如何更像静态页面:app_name/my/app.html

解析的PATH_INFO参数的时候,把最后一个参数的最后5个字符“.html”截断即可。

注意:APACHE2中缺省是不允许PATH_INFO的,需要设置 AcceptPathInfo on

http://www.15597.com/index/module/xxx/action/xxx/id/xxx

联带性文章:php 访问站点报错 cgiwrap/cgiwrap/IUSER_XXXX/index.php 找不到

http://tech.cncms.com/fuwuqi/webserver/qita/110336.html

人气教程排行