Redirecting from Localhost/Configuring localhost

Alles, was den Apache betrifft, kann hier besprochen werden.

Redirecting from Localhost/Configuring localhost

Postby SalientAnimal » 03. June 2010 22:16

Hi guys,

I have recently setuup/attempted to setup a webserver on a desktop PC. The Desktop PC is intended to host a "Local Intranet site". I have been able to get the site to fully work on the host PC itself, and the index page opens on other PCs on the network when they enter the IP address as well as the computer name into internet explorer's address bar. The index page has an auto redirect after 5 seconds to the login screen, however when this page redirects I get an error page and the address in the address bar changes to http://localhost/pagename.php. Could someone please assist me in fixing the error as this is pointing to the correct location but it does not show the page.

If I how ever type http://computername/pagename.php or http://ipaddress/pagename.php in the address bar it works on all other users on the networks PC's. Please I really need some help getting this to work. Thanks guys
SalientAnimal
 
Posts: 2
Joined: 03. June 2010 21:51

Re: Redirecting from Localhost/Configuring localhost

Postby Altrea » 03. June 2010 22:46

Hi,

SalientAnimal wrote:The index page has an auto redirect after 5 seconds to the login screen,...

Maybe it could be helpful to show us the code of this redirect

SalientAnimal wrote:however when this page redirects I get an error page

error pages have error codes. Which error code is this? 404? 403? 500?

SalientAnimal wrote:as this is pointing to the correct location

are you really really sure? Please double check this char by char.

SalientAnimal wrote:If I how ever type http://computername/pagename.php or http://ipaddress/pagename.php in the address bar it works on all other users on the networks PC's.

does it work too if you type http://localhost/pagename.php or http://127.0.0.1/pagename.php in your address bar? (don't copy&paste and don't by redirect)
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8299
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Redirecting from Localhost/Configuring localhost

Postby SalientAnimal » 04. June 2010 05:03

Nope :-(
SalientAnimal
 
Posts: 2
Joined: 03. June 2010 21:51

Re: Redirecting from Localhost/Configuring localhost

Postby Nobbie » 04. June 2010 09:03

SalientAnimal wrote:however when this page redirects I get an error page and the address in the address bar changes to http://localhost/pagename.php.


Thats because you have a redirect to "localhost", but localhost does not mean in any case your webserver, it always means your local PC where are working at (i.e. that one, where you have opened the browser).

If you are browsing on your Server itself, "localhost" points correctly to the server. But if you are browsing at a different PC, it does NOT point to the Xampp PC.

You either have to edit the code and change the redirect from "localhost" to either the LAN IP of that server or the servername (computername in Windows).

- or -

If you had to install and setup this script (you did not tell anything about it) and you where asked for a servername, you obviously entered "localhost". But this does not work in a LAN, it works only on that PC itself. You *must" enter the LAN IP or the servername instead.
Nobbie
 
Posts: 8780
Joined: 09. March 2008 13:04


Return to Apache

Who is online

Users browsing this forum: No registered users and 3 guests