Run the following command to install the rewrite module in Ubuntu: sudoa2enmodrewrite: the mod-available (disabled module) and the mod-enabled (enabled module) in the/etc/apache2 directory ). The above command alone is not enough to rewrite the mechanism for Apache to receive requests. You also need to run the command; sudovim/etc/apache2/sites-enabled/000-def
Enable rewrite module in Ubuntu
Run the following command to install:
Sudo a2enmod rewrite
In the/etc/apache2 directory, the options are "mod-available" and "mod-enabled ).
The above command alone is not enough to rewrite the mechanism for Apache to receive requests.
You also need to run the command;
Sudo vim/etc/apache2/sites-enabled/000-default
Set
AllowOverride None
Change all
AllowOverride All
The connection above/etc/apache2/sites-enabled/000-default is actually/etc/apache2/sites-available/default.
AllowwOverride None completely ignores the. htaccess file. Naturally, the rewrite rules defined in AllowwOverride do not take effect.
------------------------------------- I am a split line -------------------------------------
How does Apache Rewrite in Ubuntu enable http://www.linuxidc.com/Linux/2010-10/29027.htm?
Several highlights of http://www.linuxidc.com/Linux/2015-01/111914.htm after Apache 14.04 upgrade to 2.2 in Ubuntu 2.4
Install the LAMP \ Vsftpd \ Webmin \ phpMyAdmin service and settings in Ubuntu 13.04Http://www.linuxidc.com/Linux/2013-06/86250.htm
Compile and install LAMP (Apache 2.2.44 + MySQL 5.6.10 + PHP 5.4.12) http://www.linuxidc.com/Linux/2013-03/80333p3.htm in CentOS 5.9
Source code construction of Web Server Architecture in RedHat 5.4 LAMP environment and application PHPWind http://www.linuxidc.com/Linux/2012-10/72484p2.htm
LAMP source environment to build WEB Server Linux + Apache + MySQL + PHP http://www.linuxidc.com/Linux/2013-05/84882.htm
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2
This article permanently updates the link address: Http://www.linuxidc.com/Linux/2015-01/112117.htm