
Re-defining the DocumentRoot configuration in /Applications/XAMPP/xamppfiles/etc/nfĪ request to localhost now serves the following page: Below the DocumentRoot is changed to /User/steve/Sites/mysite: # This folder does not have to be within the /Applications/XAMPP/ folder structure. Test page for localhost with DocumentRoot set to /Applications/XAMPP/xamppfiles/htdocsĪn alternative is to re-define the DocumentRoot configuration in /Applications/XAMPP/xamppfiles/etc/nf to point to another folder and place your web site content in this new location. Perhaps the easiest option – and the one requiring least change – is to place your web site content within the default DocumentRoot folder /Applications/XAMPP/xamppfiles/htdocs/ remembering to replace, rename or delete the existing index.php there.Ī request to localhost then serves the following page: Place Web Site Content Within the DocumentRoot In the following examples, the generic index.php file below is placed within the DocumentRoot or aliased location and simply displays its name and location within the server’s folder structure: ġ. The second is to place it outside of the default DocumentRoot and use the Alias directive to map a URL to this location. The first is to place it within the default DocumentRoot. To have Apache serve your own web site content there are two main options. Line 8 of index.php performs a redirect from localhost to localhost/dashboard/ where Apache serves the XAMPP Welcome Page generated by the file index.html located in /Applications/XAMPP/xamppfiles/htdocs/dashboard/: Redirecting to localhost/dashboard in /Applications/XAMPP/xamppfiles/htdocs/index.php Something is wrong with the XAMPP installation :-( The default DocumentRoot configuration in /Applications/XAMPP/xamppfiles/etc/nfįor requests to localhost, the Apache server in XAMPP serves the file index.php located in the DocumentRoot folder /Applications/XAMPP/xamppfiles/htdocs/: # Controls who can get stuff from this server. # It can be "All", "None", or any combination of the keywords: # AllowOverride controls what directives may be placed in. Options Indexes FollowSymLinks ExecCGI Includes # The Options directive is both complicated and important. # Note that "MultiViews" must be named *explicitly* - "Options All" # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # Possible values for the Options directive are "None", "All", # symbolic links and aliases may be used to point to other locations.ĭocumentRoot "/Applications/XAMPP/xamppfiles/htdocs"

By default, all requests are taken from this directory, but

# DocumentRoot: The directory out of which you will serve your For XAMPP this is /Applications/XAMPP/xamppfiles/etc/nf and below is part of that file showing the default DocumentRoot configuration: # The location of this file will differ depending on how your computer provides a local Apache environment. This location is known as the DocumentRoot and is normally configured in a file named nf. The second part is the configuration of the local Apache server to tell it where to locate and serve the web site’s files. Throughout the remainder of this article the URL localhost is synonymous with 127.0.0.1 and. # localhost is used to configure the loopback interface

The first is the resolution of the name localhost to the IPv4 loopback address 127.0.0.1 which is configured in the local computer’s hosts file. A web site located on a local computer is accessed in a browser through the URL localhost and normally served by a local Apache server.
