Enable mod_rewrite on Ubuntu 16.04 to work with WordPress

You will need Ubuntu 16.04 server with basic “how to” LAMP stack installation. (5 min how to will be added soon)

sudo a2enmod rewrite
sudo systemctl restart apache2
sudo vim /etc/apache2/sites-available/000-default.conf

 

<VirtualHost *:80>
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>



</VirtualHost>

sudo systemctl restart apache2

 

sudo nano /var/www/html/.htaccess

 

If you would like to learn more about this subject, please take a look at Apache mod_rewrite introduction and also Apache official documentation for mod_rewrite.