http://www.15597.com/index.php/module/xxx/action/xxx/id/xxx 但是index.php能看到扩展名.php很不爽,解决方法如下: 在APACHE中这样"/> http://www.15597.com/index.php/module/xxx/action/xxx/id/xxx 但是index.php能看到扩展名.php很不爽,解决方法如下: 在APACHE中这样">

Heim >Backend-Entwicklung >PHP-Tutorial >怎样利用好PATH_INFO方式隐藏index.php文件?

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-01 14:24:241415Durchsuche

我在用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

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn