apachexamppconfightdocs

XAMPP, Can't access htdocs


I have problem accessing << localhost/htdocs >>

URLs tried: localhost/htdocs

localhost:80/htdocs

ip:80/htdocs

Always same error

ERROR:

Object not found!

The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

If you think this is a server error, please contact the webmaster.

All services are running correctly I am using port :80

I looked into apache conf :

Here is Doc Root

DocumentRoot: The directory out of which you will serve your documents. By default, all requests are taken from this directory, but symbolic links and aliases may be used to point to other locations.

DocumentRoot "C:/xampp/htdocs"

Please help I can't find the solution..

Thanks

Command Line:

Setting environment for using XAMPP for Windows.

c:\xampp

httpd -S

VirtualHost configuration:

*:443 is a NameVirtualHost

default server www.example.com (C:/xampp/apache/conf/extra/httpd-ssl.co nf:83)

port 443 namevhost www.example.com (C:/xampp/apache/conf/extra/httpd-ss l.conf:83)

port 443 namevhost www.example.com (C:/xampp/apache/conf/extra/httpd-ss l.conf:83)

ServerRoot: "C:/xampp/apache"

Main DocumentRoot: "C:/xampp/htdocs"

Main ErrorLog: "C:/xampp/apache/logs/error.log"

Mutex ssl-cache: using_defaults

Mutex default: dir="C:/xampp/apache/logs/" mechanism=default

Mutex rewrite-map: using_defaults

Mutex ssl-stapling: using_defaults

PidFile: "C:/xampp/apache/logs/httpd.pid"

Define: DUMP_VHOSTS

Define: DUMP_RUN_CFG


Does that seam correct?


Solution

  • DocumentRoot points to the root directory for a given virtual host. So you don't need to append htdocs to the URI if it is already specified in the DocumentRoot. Try:

    http://localhost
    

    Also, make sure you restart apache every time you edit a virtualhost/configuration file, since they are only checked/loaded once and that is on server startup.

    If you still cannot get it to work, then httpd -S in command line to ensure the respective vhost is correctly loaded.