lunes, 18 de abril de 2016

Activar Mod-Rewrite

Activate the mod_rewrite module with
sudo a2enmod rewrite
and restart the apache
sudo service apache2 restart
To use mod_rewrite from within .htaccess files (which is a very common use case), edit the default VirtualHost with
sudo nano /etc/apache2/sites-available/000-default.conf
Search for “DocumentRoot /var/www/html” and add the following lines directly below:
<Directory "/var/www/html">
    AllowOverride All
</Directory>
Save and exit the nano editor via CTRL-X, “y” and ENTER.
Restart the server again:
sudo service apache2 restart

Voila! To check if mod_rewrite is installed correctly, check your phpinfo() output. It should have this in it:

No hay comentarios:

Publicar un comentario