Question about index.php

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

Question about index.php

Postby Asrack » 14. October 2006 05:07

I have used XAMPP before, but never had this problem. The problem is, that my index.php will not redirect users to the folder I would like. Here is the orignal code...

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


And here is mine...

Code: Select all
<?php
   if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) {
      $uri = 'https://';
   } else {
      $uri = 'http://';
   }
   $uri .= $_SERVER['HTTP_HOST'];
   header('Location: '.$uri.'/forum/');
   exit;
?>
Something is wrong with the XAMPP installation :-(


Now, I have a folder in my htdocs folder, called forum. When I add that, it will not go toward that folder, infact all it does is send me directly to the localhost link.

Anyone wanna help me with this one?

Edit: Made a mistake on my code. :)
Asrack
 
Posts: 2
Joined: 14. October 2006 04:23

Postby Izzy » 14. October 2006 05:40

Does your Edit mean you now have it working after correcting the code error?

If not:
I just replicated what you did with your code and it works for me with no problems.

I typed:
http://localhost/ and it redirected me to the forum directory and displayed the index.html I placed in that directory.

Make sure there is an index file in the forum directory and clear your browser's cache.

Your cache is your worst enemy when making changes locally.
Set your browser to load a new page on every visit.
Close your browser after clearing the cache and changing the settings and then try again.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby Asrack » 14. October 2006 05:47

Umm, that did nothing. I tried my ip address, also my no-ip.org domain name. Also tried clearing my cache, and closing the page. That didn't work either. This is my path to Forum, just incase you think I don't have it irght :P
Code: Select all
/htdocs/forum/


Like in my code above, I have it set to just see the /forum/. Which should work, but it will not. I even tried to set a direct link to it. Using /forum/install.php, which didn't work at all.

I will test a few things and come back and edit if I can't ifnd an answer.

Thanks for trying.

Edit: I am reinstalling XAMPP. I messed up on something. But nothing that has to do with this. I realised a small problem with something I did before.
I even put the whole forum software into the htdocs folder, to ese if I could call it. A .html works fine, but when I try to call ona .php, it will not load. Says the browser cannot find it.

Edit 2:
Ok, I figured it out.
Thanks alot for trying to help me Izzy. Much appreciated.
Asrack
 
Posts: 2
Joined: 14. October 2006 04:23


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 77 guests