Forum Moderators: phranque

Message Too Old, No Replies

April Fools Help

         

pheonix123

9:52 am on Mar 31, 2008 (gmt 0)

10+ Year Member



Hi there,

I'm going to play a prank of my friend and I need your help. The idea is to redirect the entire domain to a single file, which I think I've got covered with the following .htaccess:

order deny,allow
deny from all
allow from 123.123.123.123

ErrorDocument 403 /hacked.html

<Files hacked.html>
allow from all
</Files>

So it should redirect www.blah.com as well as www.blah.com/blah to www.blah.com/hacked.html.

Right so question one is how do I add a second ip to the rule so someone else can view the site normally with me? Would it be allow from 123.123.123.123¦1.1.1.1 ?

And secondly how would I redirect just a single IP (or IP range) to the hacked.html and have everybody else view the site as normal?

Thanks in advance :)

Samizdata

12:57 pm on Mar 31, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I would use mod_rewrite for something like this:

# Turn on mod_rewrite
RewriteEngine On
# If the target IP
RewriteCond %{REMOTE_ADDR} ^00\.00\.00\.00$
# and not the joke page
RewriteCond %{REQUEST_URI} !^joke
# send to the joke page
RewriteRule /*$ joke.htm [L]

Of course, I could be joking...

pheonix123

1:43 pm on Mar 31, 2008 (gmt 0)

10+ Year Member



Cheers, I got part one working as well. Can't wait for tomorrow! :D

jdMorgan

2:49 pm on Mar 31, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



We'll hope this is not a business site -- Friendships can end and lawsuits start over less...

Jim