日期:2014-05-16  浏览次数:20426 次

动态网页地址如何变成静态
做个网站 是基于php动态的   但是点开链接都是 index.php?id=12 之类的 能不能用伪静态这个变成index_xx.html 谢谢
------解决方案--------------------
在index.php文件夹内起一个.htaccess文件
然后输入
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^index_(.*)\.html  index.php?id=$1 [NC]
</IfModule>
就可以访问 index_12.html 显示 index.php?id=12的内容
------解决方案--------------------
这些都是http服务器实现的,URL rewrite,不同的有不同的配置方式

你可以在apache/nginx等的文档中查询。