-------------------------------
参考:
1、配置Web服务器
3、Apache URL重写规则(详解)
-------------------------------
按照上文1在httpd.conf添加配置,放开LoadModule rewrite_module modules/mod_rewrite.so行的注释,启用rewrite模块。
实例:
<VirtualHost *:80>
ServerName sf.cn
ServerAlias www.sf.cn
DocumentRoot E:/wamp64/www/projectName/web
<Directory E:/wamp64/www/projectName/web>
AllowOverride All
Order Allow,Deny
Allow from All
</Directory>
# uncomment the following lines if you install assets as symlinks
# or run into problems when compiling LESS/Sass/CoffeeScript assets
# <Directory E:/wamp64/www/projectName>
# Options FollowSymlinks
# </Directory>
ErrorLog E:/wamp64/logs/project_error.log
CustomLog E:/wamp64/logs/project_access.log combined
</VirtualHost>
重启apache,完成。