具体操作是:
sudo a2enmod
- 1
终端提示可以使用的模块名称,此时输入
rewrite
- 1
提示成功加载rewrite模块,然后修改apache2的配置文件
cd /etc/apache2
sudo vim apache2.conf
- 1
- 2
然后将
<Directory /var/www/>
Options Indexes FollowSymlinks
AllowOverride None
Require all granted
</Directory>
- 1
- 2
- 3
- 4
- 5
中的AllowOverride None
改为AllowOverride All
然后重启apache即可
sudo /etc/init.d/apache2 restart
转载http://blog.csdn.net/monsterjohn/article/details/47090917