Forum Moderators: phranque

Message Too Old, No Replies

How can i redirect external clients

how to forward internet and lan queries to a different web pages.

         

Luigis

10:09 pm on May 11, 2006 (gmt 0)



I have installed Apache 2 in my lan, now i'm forwarding external queries from internet to that computer, but i have a problem, i want people from my lan (192.168.1.) can watch the index page of this computer, but external people, people from internet, could be redirected to another page.

For instance:
A person in my lan browse this address : [192.168.1.47...] they will see a intranet web page, but if a person in the intenet browse [publicip...] they will be forward to a welcome page.
is it posible to?
Thanks in advance.
Luis.

jdMorgan

12:58 pm on May 12, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It should be easy to use mod rewritew to test the %{REMOTE_ADDR} request variable, and rewrite or 302 redirect the outside users to the "welcome" page.

However, realize that HTTP is a stateless protocol, and that means they will *always* see the welcome page and never see the index page. In order to let them see both --say, the welcome page on their first request, and then the index page on subsequent requests-- you will have to set a cookie on their machine and check it (which you could also do with mod_rewrite).

For more information, see the documents cited in our forum charter [webmasterworld.com].

Jim