1. Create in the/etc/apache2/mods-enabled directory
Ln-s. /mods-available/rewrite.load Rewrite.load
Rewrite.load. /mods-available/rewrite.load
Contents of the Rewrite.load file
LoadModule rewrite_module/usr/lib/apache2/modules/mod_rewrite.so
- Terminal operation
sudo a2enmod
The program prompts the module name that is available for activation, enter:
Rewrite
Success will prompt rewrite already load
- Modify/etc/apache2/sites-enabled/000-default (this link points to a site profile)
Change the AllowOverride property (the default WWW directory, or the directory where you want to apply the. htaccess) to all, save.
For example:
[HTML] View plaincopy
DocumentRoot "/var/www"
Options followsymlinks allowoverride All
Options Indexes followsymlinks execcgi includes allowoverride all Order allow,deny
- Apache2 the relationship of several configuration files:
apache2.conf internal calls httpd.conf, conf.d/, sites-enabled/
Flexible to handle when configured