mod rewrite - How to enable mod_rewrite for Apache

Опубликовано: 12 Апрель 2026
на канале: The Training Help
9,698
46

mod rewrite - How to enable mod_rewrite for Apache.
How To Set Up mod_rewrite for Apache on Ubuntu 14.04.
How To Rewrite URLs with mod_rewrite for Apache on Ubuntu
How to enable mod_rewrite on Apache
===================================================
Run the commend.

sudo a2enmod rewrite

and restart the apache

sudo service apache2 restart

Edit file
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