Skip to content

PATH_INFO的方式来实现搜索引擎友好

2009 二月 10
by 荒野无灯

摘自:http://sushener.spaces.live.com/blog/cns!BB54050A5CFAFCDD!438.entry
我习惯使用PATH_INFO的方式来实现搜索引擎友好,比如:

http://www.xxx.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.xxx.com/index/module/xxx/action/xxx/id/xxx

喜欢这篇文章吗?

请订阅本站 RSS feed填写您的邮件地址,订阅我们的精彩内容:,欢迎点击这里捐赠以支持荒野无灯转播到腾讯微博 转播到腾讯微博

作者:荒野无灯
出处:Hacklog【Hacklog】

声明: 本站遵循 署名-非商业性使用-相同方式共享 3.0 共享协议. 转载请注明转自Hacklog【荒野无灯weblog】

本文链接: http://ihacklog.com/?p=1019

Leave a Reply

Allowed Tags - You may use these HTML tags and attributes in your comment.

<a href="" title=""> <abbr title=""> <acronym title=""> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <q cite=""> <strong>

 :wink:  :-|  :-x  :twisted:  :)  8-O  :(  :roll:  :-P  :oops:  :-o  :mrgreen:  :lol:  :idea:  :-D  :evil:  :cry:  8)  :arrow:  :-?  :?:  :!:

Note: You may use basic HTML in your comments. Your email address will not be published.

Subscribe to this comment feed via RSS