umm - localhost IS htdocs
the reason you can't access
http://localhost/htdocs is that you don't have a directory called 'htdocs' UNDER 'xampp\htdocs'
for this "http://localhost/htdocs" to work your folder would have to be "xampp\htdocs\htdocs"
xampp\htdocs is the DocumentRoot - that's where the 'public space' of your Apache server begins.
If you are wondering why the XAMPP welcome page is served when you go to
http://localhost, its because of the DirectoryIndex Apache Directive in xampp\apache\conf\httpd.conf - that determines the order in which Apache will serve various pages when you navigate to a folder in your browser and do not specify the file to be served, such as
http://localhost -
- Code: Select all
<IfModule dir_module>
DirectoryIndex index.html index.php index.pl index.cgi index.asp index.shtml index.htm \
default.php default.pl default.cgi default.asp default.shtml default.html default.htm \
home.php home.pl home.cgi home.asp home.shtml home.html home.htm
</IfModule>
in a default XAMPP install, index.php would be first on that list, and it is a redirect to /xampp/
- Code: Select all
<?php
if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) {
$uri = 'https://';
} else {
$uri = 'http://';
}
$uri .= $_SERVER['HTTP_HOST'];
header('Location: '.$uri.'/xampp/');
exit;
?>
Something is wrong with the XAMPP installation :-(
Good Luck
ysf