How to stop Xampp loading in the wrong place? [Solved]

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

How to stop Xampp loading in the wrong place? [Solved]

Postby Xamppingaround » 28. July 2012 11:45

Hi !
Just reinstalled the previous version i had (1.7.4), i made some changes on the structure of the website, by this i mean that, previously, i had my website directory in the same place where i have installed Xampp, but this succesively created me problems with Xammp, as i was unable to load up some default programs.
So, now i installed Xammp on 192.168.5.8 and my site on 192.168.5.8/x.
The problem is that every time i try to load my website, on the first try i get redirected to 192,168.5.8/Xammp.
I think it's something that has to do with configuring the Httpd.conf file inside the Apache folder, maybe every request on port 80 is getting caught by Apache???
How can i fix this???
Thanks.
Xamppingaround
 
Posts: 19
Joined: 20. July 2012 19:06
XAMPP version: Bitnami
Operating System: Windows Vista/CentOS6.8

Re: How to stop Xampp loading in the wrong place???

Postby JonB » 28. July 2012 16:53

Nooooo- LOL -

It has to do with 'index.php' in \xampp\htdocs - its a redirect to \xampp\htdocs\xampp (whihc is the XAMPP Welcome Page)

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 :-(


You either:

'had a a different index.php'

OR

'you had changed the 'index order' so a different default index was served'

httpd.conf: look for

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>



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

Re: How to stop Xampp loading in the wrong place???

Postby Xamppingaround » 28. July 2012 20:26

Thanks, so, what is the action i should take?
The index.html for my site is located in 192.168.5.8/x/index.html, would i just need to add this address on this part of the code "$uri = 'http://HERE'; " inside the 'index.php' in \xampp\htdocs ????
Xamppingaround
 
Posts: 19
Joined: 20. July 2012 19:06
XAMPP version: Bitnami
Operating System: Windows Vista/CentOS6.8

Re: How to stop Xampp loading in the wrong place???

Postby JonB » 29. July 2012 00:44

Provided that you don't have an index.php in the htdocs\x\ folder (which would be served before index.html unless you changed the index order)

this change should work:

Code: Select all
header('Location: '.$uri.'/x/');


Good Luck
8)





ycf
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

Re: How to stop Xampp loading in the wrong place???

Postby Xamppingaround » 29. July 2012 06:30

Yes thank you so much, that fixed the problem!
The site it's been offline for more than a week, now it's back to life again :D
You are such a clever black cat, i promise to give a stroke to the next cat i will came across :mrgreen:
Xamppingaround
 
Posts: 19
Joined: 20. July 2012 19:06
XAMPP version: Bitnami
Operating System: Windows Vista/CentOS6.8

Re: How to stop Xampp loading in the wrong place? [Solved]

Postby JonB » 29. July 2012 16:44

Good idea!

Cats can never get too many friendly strokes...

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 91 guests