Forum Moderators: phranque

Message Too Old, No Replies

mod rewrite

redirect to external site

         

TonyMcGuire

4:26 pm on Sep 21, 2004 (gmt 0)

10+ Year Member



I get constant requests to /winnt, /scripts, etc.

I'd like to send the visitor off to an external site:
[fbi.gov...]

I've been using proxypass directives.

Is there a better way with mod_rewrite? Proxypass doesn't seem to always catch everything.

I'm a complete newbie to mod_rewrite, so details are appreciated.

jdMorgan

4:42 pm on Sep 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



TonyMcGuire,

Welcome to WebmasterWorld!

Sure, you can proxy through to that site, but then your site will show as the REMOTE_IP address. If you use a redirect, then your site will show as the HTTP_REFERER. Not good to spam the guvmint.

May I suggest returning a 403-Forbidden response to unwelcome visitors? It's simpler, consumes no additional bandwidth, and does not pass the problem on to someone else. In .htaccess:


Options +FollowSymLinks
RewriteEngine on
RewriteRule ^(winnt¦scripts) - [F]

Change the broken pipe "¦" symbol to a solid pipe before use. Solid pipes posted on this board get modified.

Jim

TonyMcGuire

5:16 pm on Sep 21, 2004 (gmt 0)

10+ Year Member



Jim,

Thanks a million for the pointer.

I tried it, but Apache wouldn't load the modified config; it kept the older version. And I didn't get anything in the error log.

Yes, I'd prefer not to keep my URL in the Location bar. And images don't load when I do that (understandably).

Nor would I like to have referer entries on the FBI CyberCrimes site. But sending these people there are worth it. At least until the FBI shows up at my door.

Again, thank you for taking the time to help.