wamp 开启伪静态 .htaccess 重写

来源:互联网 发布:2017最火的编程语言 编辑:程序博客网 时间:2024/06/05 09:53
1,开启.htaccess支持的方法:

同样是文件:wamp\bin\apache\apache2.2.22\conf\httpd.conf(2.2.22视具体版本而定)

找到

Options FollowSymLinks

AllowOverride None

改为

Options FollowSymLinks

AllowOverride All

此方法将使所有站点默认支持htaccess,出于安全考虑,建议在vhost文件中给单个站点开启支持,方法如下:

NameVirtualHost*:80

<VirtualHost*:80>

ServerName localtest.com

DocumentRoot"E:/project/localtest"

<Directory"E:/project/localtest">

  Options IndexesFollowSymLinks Includes ExecCGI

  DirectoryIndexindex.html index.htm  index.php

 AllowOverrideAll

  Orderallow,deny

  Allow fromall

</Directory>

</VirtualHost>

 

2、开启.htaccess中rewite的支持

同样是文件:wamp\bin\apache\apache2.2.22\conf\httpd.conf(2.2.22视具体版本而定)

找到

#LoadModule rewrite_module modules/mod_rewrite.so

把井号去掉即可