How to Enable Missing ‘Localhost’ Prefix in WAMP
So you just recently installed the WAMP server on your PC/laptop and are ready to start your web development process. You launched the homepage of WAMP and clicked on the project folder in the hope of such a URL “https://localhost/yourproject” but you got an error.
When working with WAMP, it is essential to have the “localhost” prefix properly configured, as it allows you to access your local website or application from your web browser. Without it, you may encounter errors or be unable to view your projects locally.
Well, it is due to some settings, as WAMP wants you to use virtual host way to create project URLs. However, you can still enable the old way of showing URL prefixed with ://localhost.
Why WAMP Disabled Localhost Prefix?
1. Enforcing Virtual Hosts as the Default Configuration
Newer versions of WAMP require the use of Virtual Hosts instead of relying on localhost/mysite
. Previously, WAMP would automatically resolve subdirectories inside www/
(e.g., C:\wamp64\www\mysite
) when accessed via http://localhost/mysite
.
However, this approach caused conflicts when working with multiple projects, frameworks, or CMS platforms like WordPress and Laravel, which require proper domain handling. Virtual hosts provide a cleaner and more scalable way to handle multiple local projects.
2. Improved Compatibility with Modern Web Development
Many modern PHP frameworks (such as Laravel, Symfony, and CodeIgniter) depend on virtual hosts for proper routing. Instead of using http://localhost/project
, these frameworks expect a domain-like structure (e.g., http://project.test
). By enforcing virtual hosts, WAMP ensures better compatibility with modern web development practices.
3. Avoiding Issues with Apache’s Document Root
By default, WAMP’s Apache server sets www/
as the document root. However, this can cause issues with custom .htaccess rules, mod_rewrite configurations, and PHP scripts that depend on a well-defined server root. Virtual hosts allow each project to define its own root directory, avoiding potential path conflicts and misconfigurations.
4. Security Improvements
Allowing all projects to be accessible via localhost/
can expose unintended directories to web access. By requiring virtual hosts, WAMP provides better security by ensuring that only explicitly configured projects are accessible.
Steps to Fix Missing Localhost Prefix in WAMP
Step 1
First of all, go to WAMP folder and www directory
locate the index file and follow the steps as shown below

Find $suppress_localhost

Change true into false as shown below

Restart the WAMP server.
It should be working now. I hope this tutorial helped you fix the issue of missing the localhost prefix on your WAMP localhost server. If you have any questions or suggestions, please let us know in the comment section.