multiple redirects with "Limit GET HEAD POST" ???

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
marcr
Forum Newbie
Posts: 2
Joined: Sun Oct 25, 2009 8:26 pm

multiple redirects with "Limit GET HEAD POST" ???

Post by marcr »

Hello,

I want to know if I can send two different ip's to two different places, using the "order/deny" thing in htaccess.
I'm trying and reading now for a couple of hours and still no luck... :banghead:

This works, but the other one not

Code: Select all

ErrorDocument 403 http://www.altavista.com/
<Limit GET HEAD POST>
order allow,deny
deny from 11.111.111.111
allow from all
</LIMIT>

Code: Select all

ErrorDocument 403 http://www.altavista.com/
<Limit GET HEAD POST>
order allow,deny
deny from 11.111.111.111
allow from all
</LIMIT>
ErrorDocument 403 http://www.yahoo.com/
<Limit GET HEAD POST>
order allow,deny
deny from 22.222.222.222
allow from all
</LIMIT>
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: multiple redirects with "Limit GET HEAD POST" ???

Post by requinix »

mod_rewrite would be a better solution - one that works, even. Using an ErrorDocument to redirect users is practically abusive.

Code: Select all

RewriteEngine On
 
RewriteCond %{REMOTE_ADDR} ^11.111.111.111$
RewriteRule ^ http://www.altavista.com
 
RewriteCond %{REMOTE_ADDR} ^22.222.222.222$
RewriteRule ^ http://www.yahoo.com
An even better solution would be to build this redirection thing into the authentication code for your site.
marcr
Forum Newbie
Posts: 2
Joined: Sun Oct 25, 2009 8:26 pm

Re: multiple redirects with "Limit GET HEAD POST" ???

Post by marcr »

Thank you! :P
Post Reply