vagrant@vagrant-ubuntu-trusty-64:~$ apachectl -t -D DUMP_MODULES | grep rewrite
# 如果没有加载vagrant@vagrant-ubuntu-trusty-64:~$ a2enmod rewrite
Enabling module rewrite.
Could not create /etc/apache2/mods-enabled/rewrite.load: Permission denied
vagrant@vagrant-ubuntu-trusty-64:~$ sudo a2enmod rewrite
Enabling module rewrite.
To activate the new configuration, you need to run:
service apache2 restart
vagrant@vagrant-ubuntu-trusty-64:~$ less /etc/apache2/mods-enabled/rewrite.load
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
在http.conf文件中可以引用具体的rewrite规则文件,如下
1234
RewriteEngine on
RewriteLog /var/log/www/server.rewrite.log
RewriteLogLevel 1
Include /web/conf/httpd/conf.d/rewrites.conf