DromFive DromFive - 1 year ago 78
PHP Question

Error 404 on localhost with wampserver

I've been using wamp for 2 weeks at my work without any problem, but now I've some issues :

is working well, but
gives me a
error :

Not Found
The requested URL / was not found on this server.

I already tested the port
and it's used by

I have virtual hosts that works well but I can't create a new one anymore, it won't work, I don't know why.

I've searched a lot on internet but all I can find is solution that just does not work for me so if you could help me, that would be fantastic.

EDIT : I just changed my httpd-vhosts.conf, I had a mistake in my new vhosts, so now they work well, but I still have an error 404 on localhost/.

EDIT : Thank you RiggsFolly for the help, I needed to had localhost in my httpd-vhosts.conf


Ok, this sounds like the browser is trying to use the IPV6 network but you have not entered the IPV6 loopback address into the hosts file

Amend your hosts file to be localhost other.dev other2.dev

::1 localhost
::1 other.dev
::1 other2.dev

The ::1 is the IPV6 loopback address just as is the IPV4 loopback address.

You say you have Virtual Hosts setup, did you also define one, the first one for localhost. Once a Virtual Host is defined the default in httpd.conf for localhost is ignored.

So add this to the top of httpd-vhosts.conf

<VirtualHost *:80>
    ServerName localhost
    DocumentRoot c:/wamp/www
    <Directory  "c:/wamp/www/">
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Require local

Change c: to whatever drive you installed WAMPServer onto.