Redirect page

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Redirect page

Postby loopin3 » 14. May 2012 09:10

HI all ,
i have a problem with xampp on windows XP SP3...
My xampp work for a index.html ( the root doc is default directory) with a few link to other page and it is a simple page in html language ( the root doc is default directory) .. when i surf my webserver http//ip-address/ my broswer go to http//ip-address/xampp with 403 error , i want redirect this page to my index.html.. how can i change this configuration????
Can we help me???

Tank you and sorry for my english...
loopin3
 
Posts: 1
Joined: 14. May 2012 09:05
Operating System: Windows XP

Re: Redirect page

Postby JonB » 14. May 2012 22:16

Hello -

this is due to an Apache Module and the Directive values it is configured with

The Module is dir_module.

Look for this (probably in your \xampp\apache\conf\httpd.conf file):

Code: Select all
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
    DirectoryIndex index.php index.pl index.cgi index.asp index.shtml index.html 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>

This tells Apache what file to serve if a Directory Index is requested (that is what happens when you do not specify a specific page by its URL.)

Since index.php comes before index.html, the index.php (which is a redirect to /htdocs/xampp/index.php) is served. Change the DirectoryIndex line so index.html is BEFORE index.php, save the file and restart Apache.

Code: Select all
 DirectoryIndex index.html index.php index.pl index.cgi index.asp index.shtml index.htm \


Now Apache should serve your index.html file when you point your browser to http://localhost/ :D

You can also change that directive with a .htaccess file on a directory by directory basis, or by specifying the values in a 'Directory' directive. Apache usually has many ways to do the same thing.

http://httpd.apache.org/docs/2.2/mod/mod_dir.html

https://httpd.apache.org/docs/current/m ... #directory

You could also delete \xampp\htdocs\index.php OR rename it to a different value. BUT then you would not know why this works...


Good Luck
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 211 guests