Solved: WordPress Permalinks Not Working in Ubuntu 16.04

1. Open the Ubuntu Terminal and type in the following code:

$ sudo gedit /etc/apache2/apache2.conf

2. A text editor will pop up. Look for the following lines of code:

<Directory /var/www/html>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>

3. Create more space below the lines of code in Step 2.

4. Copy the bits of code below and paste them into the space you created in Step 3:

# START OF ADDED CODES
<Directory /var/www/html>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
# END OF ADDED CODES

5. Save the file.

6. Go back to the Ubuntu Terminal and type in the following code to restart Apache:

$ sudo service apache2 restart