Forum Moderators: phranque

Message Too Old, No Replies

Forwarding a specific visitor to an different page?

need show a specific visitor warning that his IP was banned

         

vanowm2

5:35 pm on Jan 17, 2003 (gmt 0)

10+ Year Member



I have search on this forum, and only could find how to ban a specific IP.
but also I'd like show that visitor why he can not open the page.
so I was thinking about farwarding to a page where it will explayed what happend.
I'm very n00b in web servers, I know it's possible do with modrewrite, but how?
thank in advance!

oilman

6:42 pm on Jan 17, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld :)

Have a read of this thread: [webmasterworld.com...]

I believe it will accomplish what you need. Have fun :)

vanowm2

12:12 am on Jan 18, 2003 (gmt 0)

10+ Year Member



thank you very much!
that's exactly what I needed.
but now I have another question.
I set .htaccess redirect a visitor with IP x who visit my site [mysite.com...]
to [mysite.com...]
I also placed .htaccess in the root of the server.
so, it does redirect as it supposed, but visitor doesnt get anything, becase apache just keeping redirect, because it see the IP that should be redirected.
so, I was wandering, in this case, is that possible, that apache ignore redirection for this specific file?
thx!

andreasfriedrich

12:18 am on Jan 18, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Add a RewriteCond directive that checks whether REQUEST_URI is not the URI pointing to the file that users get redirected to.

vanowm2

12:32 am on Jan 18, 2003 (gmt 0)

10+ Year Member



thx, but if u would...give me an example (; I really dont know what do u mean...

jdMorgan

5:05 am on Jan 18, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



vanowm2,

Put the unwelcome visitor's IP address in the RewriteCond line, with "\" preceding each period.
The RewriteCond will prevent the redirect unless the IP address matches.
The Rewrite rule will redirect any request for any file except "banned.php" to banned.php.


Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REMOTE_ADDR} ^12\.34\.56\.78$
RewriteRule !^banned\.php$ /banned.php [R=301,L]

More info: Introduction to mod_rewrite [webmasterworld.com]

Jim

vanowm2

3:31 pm on Jan 18, 2003 (gmt 0)

10+ Year Member



woohoo! thank you very much! I'm all set now.
:):):)