Home  >  Article  >  Backend Development  >  如何实现伪静态

如何实现伪静态

WBOY
WBOYOriginal
2016-06-23 13:25:50910browse

如何在php程序中把http://www.kaimen360.com/exquisite.php?mod=show&id=512实现伪静态?


回复讨论(解决方案)

Server: Apache
X-Powered-By: PHP/5.3.27

在 Apache 中启用 url rewrite 功能

具体怎么 ,要看你的规则了

可以使用apache rewrite来实现。
具体要看你的规则是怎样的。

例如:
http://www.kaimen360.com/exquisite.php?mod=show&id=512
想显示为
http://www.kaimen360.com/exquisite_512.html

可以在根目录中创建一个.htaccess文件
内容如下:

<IfModule mod_rewrite.c>RewriteEngine onRewriteRule 'exquisite_(.*)\.html' exquisite.php?mod=show&id=$1 [NC]</IfModule>

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