XAMPP is a web server solution stack package that helps us to build a development envirnment in minutes, but you may meet this Error 404 problem when accessing your website.

Error 403 – Accesss Forbidden

It is because that web server denys all requests by default, so we need to do a bit modification to the configuation file.

Step 1. Open httpd.conf

Open the configuation file called httpd.conf

Open httpd.conf

Step 2. Find appropriate code

Then find the code section that looks like the following text.

#
# Deny access to the entirety of your server's filesystem. You must
# explicitly permit access to web content directories in other 
# <Directory> blocks below.
#
<Directory />
    AllowOverride none
    Require all denied
</Directory>

Step 3. Modify code

Comment out AllowOverride none and Require all denied, then add the following code.

Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order deny,allow
Deny from all
Allow from 127.0.0.1

Save changes. The next step is to restart Apache to take effects.

Full example:

#
# Deny access to the entirety of your server's filesystem. You must
# explicitly permit access to web content directories in other 
# <Directory> blocks below.
#
<Directory />
    # AllowOverride none
    # Require all denied

    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Order deny,allow
    Deny from all
    Allow from 127.0.0.1
</Directory>

Step 4. Restart

Start Apache web server.

Last modified: January 25, 2020

Author

Comments

Write a Reply or Comment

Your email address will not be published.