当前位置:首页 > 服务器技术 > apache

PHP开发入门-Apache开启伪静态详解

环境:
系统 Windows
Apache 2.2

加载Rewrite模块:

在conf目录下httpd.conf中找到

LoadModule rewrite_module modules/mod_rewrite.so

这句,去掉前边的注释符号“#”,或添加这句。

允许在任何目录中使用“.htaccess”文件,将“AllowOverride”改成“All”(默认为“None”):

#
 AllowOverride controls what directives may be placed in .htaccess files.
#
 It can be “All”, “None”, or any combination of the keywords:
#
 Options FileInfo AuthConfig Limit
#
AllowOverride All

在confhttpd.conf 最后一行添加

RewriteEngine OnRewriteRule ^(.*)-htm-(.*)$ $1.php?$2

以上就是PHP开发入门-Apache开启伪静态详解的详细内容,更多请关注Gxl网其它相关文章!


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!