How to enable mod_rewrite on Apache?

参考:http://www.ewhathow.com/2013/09/how-to-enable-mod_rewrite-on-apache/

Lets check if mod_rewrite exists as a module:
ls /etc/httpd/modules | grep mod_rewrite

Use the following command to check if mod_rewrite is loaded or enabled:
grep -i LoadModule /etc/httpd/conf/httpd.conf | grep rewrite

If you don’t see any of these, add the following line to your httpd.conf:
LoadModule rewrite_module modules/mod_rewrite.so

Type in the following command:
grep -i AllowOverride /etc/httpd/conf/httpd.conf
You need to replace None with All if it is not already All.
在/var/www/html目录下的 AllowOverride 改成 All 就ok了

原文地址:https://www.cnblogs.com/qike/p/5407717.html