Not Found The requested URL was not found on this server.

Not Found The requested URL was not found on this server.

Autopublished from RSS Original article

Ubuntu Apache 2 – Not Found The requested URL was not found on this server.

Ubuntu Apache 2 on WordPress – Not Found The requested URL was not found on this server.

Explanation: Here are a few things to try to fix the “Not Found The requested URL was not found on this server” error in Apache on Ubuntu:

1. Check that the Apache service is running:

sudo systemctl status apache2

2. Make sure the required modules are enabled (like _mod_rewrite_):

sudo a2enmod rewrite

3. Check the Apache configuration files for errors:

sudo apache2ctl configtest

4. Make sure the directory/file you are accessing actually exists and has the right permissions.

5. If you are using WordPress add the following to .htaccess in public folder.

BEGIN WordPress

RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]

END WordPress

6. Mod_rewrite Configuration.
If you are using mod_rewrite for URL rewriting, make sure it is enabled and configured correctly in your virtual host file.
Replace below code

Options Indexes FollowSymLinks AllowOverride None Require all granted

to

Options Indexes FollowSymLinks AllowOverride All Require all granted

7. Check the Apache access and error logs for more details on the 404 error:

/var/log/apache2/

8. Restart Apache after any configuration changes:

sudo systemctl restart apache2

If the issue persists, enable debug logging and check those logs. Also try accessing the server locally to narrow down connectivity issues.

Let me know if you have any other specific details on the error – happy to help further troubleshoot!

Did you find this article valuable?

Support Abhay Singh by becoming a sponsor. Any amount is appreciated!