how to redirect to my ip?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
susrisha
Forum Contributor
Posts: 439
Joined: Thu Aug 07, 2008 11:43 pm
Location: Hyderabad India

how to redirect to my ip?

Post by susrisha »

My apache server runs on my localmachine that is linked to some more systems by LAN. All the systems in LAN are connected to a router and we have a static ip to link and host the application to show to the customers.

The problem is:
I have to give the location of a file through the url. This works fine by using $_SERVER variable for the ip address but only in the local machine and in lan. When anyone from outside the lan uses it, it doesnt give the ip of the static ip. This way its not possible for me to give the url location of the file.

How do i solve this?

One of the possible solutions might be to index the Lan machines(my lan machines have 192.168.1.* ips) and if it is not one of those, i will have to manually set it to the public ip.

How do i do this??
jason.carter
Forum Commoner
Posts: 35
Joined: Sat Jan 10, 2009 10:05 am

Re: how to redirect to my ip?

Post by jason.carter »

what is the link you give to others to access your site in LAN?
User avatar
susrisha
Forum Contributor
Posts: 439
Joined: Thu Aug 07, 2008 11:43 pm
Location: Hyderabad India

Re: how to redirect to my ip?

Post by susrisha »

I give the localip of my system for accessing my site in lan. my local ip is 192.168.1.103 and for everyone in the lan i give it like http://192.168.1.103:9090/mysite/
I am running apache on port 9090 for some other reasons.
Post Reply