WordPress Localhost Page Not Found

For a WordPress website installed on the local computer I was seeing a 404 Not Found error when navigating to a page.

I had selected the option Common Settings by Post Name on the Settings page Permalink Settings.

As an example I was unable to navigate to the page http://localhost/wordpress/about-us/

The error shown on the page was:

Not Found
The requested URL /wordpress/about-us/ was not found on this server.


Apache/2.4.12 (Debian) Server at localhost Port 80

Reviewing the .htaccess file there was nothing untoward.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>

I then checked the Apache config file

/etc/apache2/sites-available/000-default.conf

I had added a section relevant to the local WordPress site, this section is shown below:

DocumentRoot /usr/share/wordpress
<Directory /usr/share/wordpress>

  Options +MultiViews
  Options FollowSymLinks
  Options -Indexes
  AllowOverride All
  Order allow,deny
  Allow from all

</Directory>

Again this looked to be correct when compared with another server. In this file AllowOverride is set to All.

Considering possible options I tried enabling mod rewrite:

I enabled mod-rewrite using

root@local:/etc/apache2/sites-available# a2enmod rewrite

Executing this command returns:

Enabling module rewrite.
To activate the new configuration, you need to run:
service apache2 restart

Therefore as requested, and expected, I restarted Apache:
root@local:/etc/apache2/sites-available# service apache2 restart

Returning to the website once more the pages were rendering correctly.problem resolved! mod-rewrite had not been enabled.