2

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?

3
  • 2
    Why are you typing htdocs? Just localhost should be sufficient. Commented Dec 9, 2013 at 21:28
  • I am planing to store all my web sites that I am building and testing into htdocs/ folder.. And currently there is an index.html and php in there but I can't access any of those files. If I only user localhost it just loads the main xampp page Commented Dec 9, 2013 at 21:31
  • this link will help you. Commented Apr 19, 2014 at 15:30

4 Answers 4

5

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.

Sign up to request clarification or add additional context in comments.

6 Comments

I just tried the -S not sure if the return is what it should be, could you please look I have added it up top?
Welcome to XAMPP for Windows! Congratulations: You have successfully installed XAMPP on this system! Now you can start using Apache and Co. You should first try »Status« on the left navigation to make sure everything works fine. For OpenSSL support please use the test certificate with 127.0.0.1 or localhost Good luck,
Ok, thats good. Now what exactly do you want to do ? Do you want to see the directory listing ? If yes, then remove or rename index.html
I would like to inside the /xampp/ directory have a new directory called what ever www or example htdocs... Now with in that new folder I want to make folders like "SiteOne", "SiteTwo","WordPress SiteOne"...
Navigate to C:/xampp/htdocs - add a new folder called siteone, then in the browser type localhost/siteone and wala.
|
2

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.

Comments

1

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.

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.