打开Apache的配置文件httpd.conf
1,
#LoadModule rewrite_module modules/mod_rewrite.so把前面的 “#”去掉
2,
#
# 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 None把 AllowOverride None 改为 AllowOverride All
3,让Apache支持.htaccess
Options FollowSymLinks
AllowOverride None修改为
Options FollowSymLinks
AllowOverride All重启Apache即可以生效
通过php提供的phpinfo()函数查看环境配置,通过Ctrl+F查找到“Loaded Modules”,其中列出了所有apache2handler已经开启的模块,如果里面包括“mod_rewrite”,则已经支持,不再需要继续设置。
247

被折叠的 条评论
为什么被折叠?



