Question

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?

Was it helpful?

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.

OTHER TIPS

I think this is a port issue, I faced same kind of issue and I solved it following way I opened the xampp control panel and clicked on the cofig button for apache service, opened the first link, Apache(httpd.conf) - this can be found in xampp\apache\conf directory also.

Then searched '80'(without quoatation) and changed them to 81 and saved the file. Restarted the apache service.

Typed 'localhost:81/project_folder/' in the browser.

Then it worked fine.

I have been facing the same problem of late. It is because I have been including htdocs in the URI but it unnecessary thats why the error occurs.

Try this Working with XAMPP

Under XAMPP root directory there is a folder called htdocs. That is where you should put your web site related stuff. For each web site you create, it is better to create a folder inside htdocs folder and then put content inside that to avoid conflicts.

For an example, you can create a folder called learnphp inside htdocs folder and put welcome.php inside that. Then you can access it via the URL

http://localhost/learnphp/welcome.php.

Hope it helps.

You need to configure the VHosts Config file to point at your htdocs folder

Read the docs at: http://127.0.0.1/dashboard/docs/configure-vhosts.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top