欢迎您访问我的笔记本站旨在于记录一些平时工作中遇到的一些问题和解决方法,方便查阅,部分内容来源于网络,如有侵权请联系我删除
  • 微信微信
您现在的位置是:首页 > PHP后端

Windows下Apache如何开启Rewrite模块-[原创]

日期:2018-08-04 14:40:09 作者:tanyi 来源:我的笔记 浏览:1038 次
很多时候刚搭建的环境在第一次浏览项目时首页时正常的,但是点击任何一个子菜单会提示xxxx was not found on this server.这一般是apache没有开启重写的功能

Windows如何开启Rewrite模块


环境:

系统 Windows

Apache 2.4


加载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


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


提交评论
评论列表