rewrite rules (redirect all request to a single host)

This is a discussion on rewrite rules (redirect all request to a single host) within the Apache Web Server forums, part of the Web Server and Related Forums category; sorry about this new message... i just noticed, that i messed up a running thread with the same subject. >&...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-17-2004
moritz gartenmeister
 
Posts: n/a
Default rewrite rules (redirect all request to a single host)

sorry about this new message... i just noticed, that i messed up a
running thread with the same subject.

>> hi
>>
>> i redirect http traffic from blocked users to a internal webserver,

to
>> inform them, that they are blocked and to give some other 'useful'
>> information.
>>
>> this is working only if they use 'simple' urls as www.google.com,
>> www.cnn.com etc.
>>
>> it doesn't work for urls with subdirectories as www.google.com/news
>> and so on.
>>
>> i tried a little bit with the rewriting rules, but honestly it does
>> not work at all.
>>
>> has someone a solution for it or some good links?

>
>Can you give us some more info on your current configuration? Do
>you have Apache configured as a forward proxy server?
>


apache is running on the gateway, where the users get blocked. this
are the iptables rules for redirecting:

$IPTABLES -t nat -A PREROUTING -p tcp --dport 80 -m mac --mac-source
$i -j REDIRECT --to-port 80 || error=1
$IPTABLES -t nat -A PREROUTING -m mac --mac-source $i -j DROP ||
error=1

apache server has nothing special. no virtual host, no proxy. but one
tricky thing, our official webserver uses some pages via proxy pass:

ProxyPass /orange/ http://172.17.0.9/
ProxyPass /orange/traffic/ http://172.17.0.9/traffic/

in future it is planned to use ssl proxypass... if this is possible.

all i want now is, that every http-request done by a blocked user will
go to 172.17.0.9/index.php.

if a user tries to connect to:
www.google.ch
www.nzz.ch
www.google.ch/news
www.bild.t-online.de/BTO/index.html

everything should be redirected to 172.17.0.9/index.php.

172.17.0.9 is the localhost.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:14 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0