TSF – Giải pháp IT toàn diện cho doanh nghiệp SMB | HCM

P3 - Fix 404 Error Xampp SnipeIT and Configure XAMPP Auto Start

🚀 SnipeIT – P3 Complete Guide: Fix 404 Error & Configure XAMPP Auto Start Services on Windows

If you’re encountering a 404 Not Found error in XAMPP while running Snipe-IT, you’re not alone. This is one of the most common issues when deploying Laravel-based applications like Snipe-IT on Windows. The problem usually comes from incorrect VirtualHost configuration, disabled rewrite modules, or misconfigured .env settings.

In this complete step-by-step guide, you’ll learn how to properly fix the 404 error in XAMPP, configure Apache VirtualHost correctly, adjust the .htaccess file, and clear Laravel cache to restore full functionality.

We also explain how to ensure your XAMPP services are stable and properly configured to avoid repeated downtime. Whether you’re a developer, system administrator, IT support engineer, or student, this tutorial will help you optimize your Windows development environment.


🔍 Why Does 404 Error Happen in XAMPP?

Before fixing the issue, it’s important to understand the common root causes:

  • Apache DocumentRoot pointing to the wrong directory

  • mod_rewrite not enabled

  • Incorrect .htaccess configuration

  • APP_URL mismatch in .env

  • Cached Laravel configuration

Now let’s fix it step by step.


🛠️ Step 1: Set VirtualHost Correctly

The most important fix is configuring Apache VirtualHost properly.

Open this file:

 
C:\xampp\apache\conf\extra\httpd-vhosts.conf

Add or modify the configuration as follows:

💻
filename.bash
<VirtualHost *:80>
ServerName 192.168.16.134
DocumentRoot "C:/xampp/htdocs/snipe-it/public"

<Directory "C:/xampp/htdocs/snipe-it/public">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>

ErrorLog "logs/snipeit-error.log"
CustomLog "logs/snipeit-access.log" common
</VirtualHost>

⚠️ Important:

  • Make sure DocumentRoot points to the /public directory.

  • AllowOverride All is required for .htaccess to function properly.

  • Save the file after editing.


🔄 Step 2: Edit .htaccess File in Public Directory

Next, verify the .htaccess file inside the public folder.

File location:

 
C:\xampp\htdocs\snipe-it\public\.htaccess

Ensure the content is exactly:

💻
filename.bash
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>

RewriteEngine On
RewriteBase /

# Redirect Trailing Slashes...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>

This configuration ensures Laravel routing works correctly and prevents 404 errors caused by missing rewrite rules.


⚙️ Step 3: Edit Snipe-IT .env File

Open the .env file:

 
C:\xampp\htdocs\snipe-it\.env

Update the following line:

 
APP_URL=http://192.168.16.134

Make sure:

  • The IP address matches your server IP.

  • The URL matches your VirtualHost ServerName.

If these values don’t match, Laravel will generate incorrect routing paths, resulting in 404 errors.


🔁 Step 4: Restart Service and Clear Cache

After making configuration changes, you must clear Laravel cache.

Open CMD and run:

 
cd C:\xampp\htdocs\snipe-it
php artisan config:clear
php artisan cache:clear
php artisan route:clear

These commands:

  • Clear configuration cache

  • Clear application cache

  • Clear route cache

This ensures Laravel loads the updated configuration.

After that:

  • Restart Apache from XAMPP Control Panel

  • Stop → Start

Now test your Snipe-IT URL again.


⚡ Additional Stability Tips

To prevent future issues:

✔ Always point DocumentRoot to /public
✔ Keep .env APP_URL consistent
✔ Clear cache after config changes
✔ Ensure Apache port 80 is not used by another service
✔ Enable Apache service in XAMPP if needed

You can also configure Apache and MySQL to run automatically when Windows boots by setting them as Windows services inside XAMPP Control Panel. This ensures your development environment is always ready.


🎯 Final Result

After following this complete guide:

  • 404 error will be resolved

  • Laravel routing will function properly

  • Apache VirtualHost will be correctly configured

  • Snipe-IT will load without issues

  • Your Windows XAMPP environment will be more stable

This method works for all Laravel-based applications running on XAMPP, not just Snipe-IT.


🔥 Conclusion

Fixing the 404 error in XAMPP for Snipe-IT requires correct VirtualHost configuration, proper .htaccess setup, and clearing Laravel cache. Once configured properly, your local server will run smoothly without unexpected routing issues.

This guide eliminates downtime and helps maintain a professional, stable development environment.

If you’re building a full Snipe-IT deployment series (P1 Linux, P2 Windows, P3 Troubleshooting), this tutorial perfectly completes your installation workflow.

See also related articles

P13 – Ultimate QR Code SnipeIT Setup Made Easy

P13 – Ultimate QR Code SnipeIT Setup Made Easy SnipeIT – P13 QR Code Setup Guide | Create and Print Asset QR Codes Managing IT assets without proper labeling can quickly become chaotic.When devices move between departments, employees leave, or audits happen, identifying assets manually wastes time and increases errors....

Read More

P12 – Ultimate Bulk Method to Check In Check Out Assets in SnipeIT

P12 – Ultimate Bulk Method to Check In Check Out Assets in SnipeIT SnipeIT – P12 The Fastest Way to Check-In & Check-Out Assets in Snipe-IT (Bulk Method) Managing a few devices manually is easy. Managing 100–500 assets during onboarding, offboarding, or department transfers? That’s a different story. If you...

Read More

P11 – Ultimate Guide to Check In Check Out in SnipeIT

P11 – Ultimate Guide to Check In Check Out in SnipeIT SnipeIT – P11 How to Manage Check In Check Out in SnipeIT (Step-by-Step) Efficient asset tracking is the backbone of every IT department. If you cannot accurately manage Check In check Out in SnipeIT, your asset database quickly becomes...

Read More