The Requested URL was Not Found on This Server Apache/2.4.41 in Ubuntu 22.04

10-Feb-2023

.

Admin

The Requested URL was Not Found on This Server Apache/2.4.41 in Ubuntu 22.04

Hi Guys

Now, let's see tutorial of The Requested URL was Not Found on This Server Apache/2.4.41 in Ubuntu 22.04. We will look at example of Not Found The Requested URL was Not Found on This Server in Ubuntu 22.04. you can understand a concept of The Requested URL was Not Found on This Server - Ubuntu 22.04. you can see How to Fix Common Problems With Apache2 in Ubuntu 22.04.

You can use this post for ubuntu 14.04, ubuntu 16.04, ubuntu 18.4, ubuntu 20.04, ubuntu 21 and ubuntu 22.04 versions.

When you install Apache2 on a Linux server. At that time the mod_Rwrite module is not enabled by default on Apache 2.

Step 1: Update dependencies


If you are not installed apache 2 in ubuntu.

sudo apt-get update

Step 2: Enable mod_rewrite Apache By a2enmod Command

Then type a2enmod command to enable any modules in Apache 2 web server:

sudo a2enmod rewrite

Step 3: Allow .htaccess File for VirtualHost

This "AllowOverride All" needs to be added to your virtualhost configuration file.

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

Then you need to add this “AllowOverride All” in your VirtualHost configuration file like below

<VirtualHost *:80>

ServerName www.example.com

DocumentRoot /var/www/html

<Directory /var/www/html>

Options Indexes FollowSymLinks

AllowOverride All

</Directory>

</VirtualHost>

Step 4: Restart Apache 2

If you have follow above 3 steps successfully.

sudo systemctl restart apache2

#Ubuntu