Enable Apache Rewrite Module

Posted by Morgan Billingsley on December 30, 2019 6:49 pm

Step 1: Check

First, check to see if Apache’s rewrite module is already loaded on your server by entering the following command into your terminal:

sudo apache2ctl -M | grep rewrite

If the above command returns rewrite_module (shared) then the rewrite module is already enabled on your server. If nothing is returned from the above command, proceed to the next step to install the module.

Step 2: Install the Rewrite Module

Install the rewrite module with the following command:

sudo a2enmod rewrite

Restart apache2 to enable the module:

sudo systemctl restart apache2

Check again to see if the module has been properly installed:

sudo apache2ctl -M | grep rewrite

The above command should return rewrite_module (shared).