![]() |
Web Page Help
Ok, I've bashed my head for the last few hours.
I'm trying make a simple redirect script for a web page If your IP address begins with 207.206 goto http://this site.com else goto http://that.site.com I don't care how it's occomplished (php, server config, java, javascript,etc) It's on a apache 1.3.19 server that I have complete control over. I've spent the last couple of hours trying to do it with javascript, and everything I've come up with is Netscape only. Arrg! Can anyone help? Please? |
heres some php
PHP Code:
I didn't test it out. Let me know if it doesnt work, and I'll fix it. |
Um?
Um, how's this work.
I'm assuming the file has to be renamed from index.html to index.php? Never dealt with PHP before? Quote:
|
Re: Um?
Ok, I've enabled SSI on the server, turned on XBitHack, and made the page executable.
It was halfway working, but now it's not. by halfway I mean this. I should have been clearer in my example. if 207.206 https://netreg.bridgew.edu/indexresnet.html else https://netreg.bridgew.edu/indexall.html I had those two locations in there, and when it was partway working, it would redirect to the httpS, but it wouldn't pick up the document. |
Do you have mod_rewrite setup on your Apache server?
|
Solution is Found
Ok, I called in one of the programming guru's at work, and in trying to explain it to him, I hit apon the solution.
The solution that I've discovered is a combination of Javascript and SSI includes. Code:
<noscript><meta http-equiv="refresh" content="2; URL=indexresnet.html"></noscript>Thanks for all your suggestions, you guys at least got me started on the right road. |
Ok, just a small minor update. The previous script I posted don't work.
I did a google search on SSI redirects Came up with this script. Keep in mind this is the entire webpage. Code:
<!--#if expr="${REMOTE_ADDR} = /192.168.10/" --> Kinda neat, eh? The pages I want displayed are completely contained in the .html files. Too bad no one had mentioned server side includes to me before. (they've been suppored since both browsers verion 2.0) |
oh yea :p
i mainly use SSI for including files <!--#include virtual="/file/to/include/here.html"--> and executing cgi's <!--#exec cgi="/cgi/date.pl"--> forgot about the scripting capabilities. |
Using Flash 5
You can use Flash 5 to re-direct to any file. It is simple and most people have the plug-in for it.
|
| All times are GMT -5. The time now is 07:54. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi