Solved: WordPress Permalinks Not Working in Ubuntu 18.04

1. Open the Ubuntu Terminal and enter the code below:

$ sudo gedit /etc/apache2/apache2.conf

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

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

3. Change the None in AllowOverride None to All:

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

4. Save the file and close it.

5. Go back to the Ubuntu Terminal and type in the line below to restart Apache:

$ sudo service apache2 restart