XAMPP is a web server solution stack package that helps us build a development environment in minutes. However, you might encounter an Error 404 when trying to access your website.
The Access Forbidden error, also known as HTTP 403, is a standard HTTP status code that is communicated from a web server to a client (such as a web browser) to indicate that access to the requested resource is denied or forbidden.
This occurs because the web server denies all requests by default. To resolve this issue, we need to make a small modification to the configuration file.
Steps to Solve this Problem
Step 1. Open httpd.conf
Open the configuration file named httpd.conf.
Step 2. Find the Appropriate Code
Next, locate 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 the Code
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 the changes. The next step is to restart Apache for the changes to take effect.
# # 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
Restart the Apache web server.
In this guide, we explored how to address the Error 404 issue that can be encountered when using XAMPP. The resolution involved making modifications to the httpd.conf configuration file to allow access to the server. The steps were:
- Opening the httpd.conf configuration file.
Locating the appropriate code section that handles access permissions.
- Modifying the code to allow access from your local machine.
- Restarting the Apache web server to apply the changes.
It's important to remember that configuring a web server involves several security considerations. The modifications made in this guide are primarily for a development environment and may not be suitable for production use. When setting up a live server, it is essential to pay close attention to security best practices to protect your data and applications.
If you encounter any issues or need further clarification on any of the steps, don't hesitate to consult the XAMPP documentation or seek advice from the community forums.