Home  >  Article  >  Backend Development  >  Implement search engine friendliness through PATH_INFO and hide index.php_PHP tutorial

Implement search engine friendliness through PATH_INFO and hide index.php_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:42:051352browse

I am used to using PATH_INFO to achieve search engine friendliness, such as:

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

But it’s very unpleasant to see the extension in index.php. The solution is as follows:

How to hide applications: For example, .php, extension:

Configure it like this in APACHE:

ForceType application/x-httpd-php

How to behave more like a static page: app_name/my/app.html

When parsing the PATH_INFO parameter, just truncate the last 5 characters ".html" of the last parameter.

Note: PATH_INFO is not allowed by default in APACHE2, you need to set AcceptPathInfo on

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

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/486086.htmlTechArticleI am used to using PATH_INFO to achieve search engine friendliness, such as: http://www.xxx.com/ index.php/module/xxx/action/xxx/id/xxx But it is very unpleasant to see the extension in index.php. The solution...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn