Apache开启Rewrite伪静态

环境:Windows 2003 

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     //  默认的None 改成All

在Windows系统下不能直接建立“.htaccess”文件,可以在命令行下使用“echo a> .htaccess”建立,然后使用记事本编辑

剩下的伪静态规则是类正则表达式的~  每个做网站的都懂~

原文地址:https://www.cnblogs.com/yangxiaofei/p/5149104.html