Apache2 mod_rewrite / mod_proxy problem

Hi,

I want to serve a website wich is on a server in our DMZ (10.2.1.10).
There is one (apache) server connected to the internet (accessable by a few dns entries)

The main reason to block all exept IE is that the site contains material that should be only accessable by my colleages and they shouldn't be able to download the contents with ease.

I have this vitrualhost and it works great,

<VirtualHost *:*>
ProxyPreserveHost On
ProxyPass / http://10.2.1.10/
ProxyPassReverse / http://10.2.1.10/
ServerName tst.no-ip.org
ErrorLog /var/log/apache2/error.log-nuggets
LogLevel notice
CustomLog /var/log/apache2/access.log-nuggets combined
ServerSignature On
</VirtualHost>

Considdering this site only supports IE, i want to redirect all other User Agents to an error page. Thus in comes mod_rewrite.
I've came up with this:

<VirtualHost *:*>
DocumentRoot /var/www/nuggets-test.iconnect.no-ip.org/
RewriteEngine On
RewriteLogLevel 9
RewriteLog "/var/log/apache2/tst-rewrite_log"
RewriteCond %{HTTP_USER_AGENT} ^.*MSIE.*$
RewriteRule / "http://10.2.1.10/index.html" [P,L]
RewriteCond %{HTTP_USER_AGENT} !^.*MSIE.*$
RewriteRule / "http://tst.no-ip.org/error.html" [L]
ServerName test.no-ip.org
ErrorLog /var/log/apache2/error.log-nuggets
LogLevel notice
CustomLog /var/log/apache2/access.log-nuggets combined
ServerSignature On
</VirtualHost>

However, this does not work, i see no pictures/wrong style sheet. the rewriting seems to work ok.

I'm stuck, can anyone help me?
LVL 3
NoordeloosAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

manav_mathurCommented:
You need possibly just one rewrite rule, that of the error

RewriteCond %{HTTP_USER_AGENT} ! MSIE
RewriteRule ^.*$ "http://tst.no-ip.org/error.html" [R]
0
ahoffmannCommented:
you redirect *any* request from non-IE to the same URL, hence a picture is also redirected to that URL
not shure if this works:

RewriteCond %{HTTP_USER_AGENT} !^.*MSIE.*$
RewriteRule / "http://tst.no-ip.org/error.html" [R,L]

oops, Manav still said this ;-)
0
AlexeyZilberCommented:
Change:
RewriteCond %{HTTP_USER_AGENT} ^.*MSIE.*$
RewriteRule / "http://10.2.1.10/index.html" [P,L]

To:
RewriteCond %{HTTP_USER_AGENT} ^.*MSIE.*$
RewriteRule ^[/]?(.*) http://10.2.1.10/$1 [P,L]
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
NoordeloosAuthor Commented:
The P did the trick!
This is it now:


<VirtualHost *:*>
<Proxy *>
 Order Allow,Deny
 Allow from All
 Deny from 62.163.35.169
 Deny from 80.60.167.164
</Proxy>

ServerSignature On
ServerName test.iconnect.no-ip.org
RewriteEngine On
RewriteLogLevel 1
RewriteLog "/var/log/apache2/iconnect.no-ip.org/rewrite.log"
RewriteCond %{HTTP_USER_AGENT} ^.*MSIE.*$      [OR]
RewriteCond %{HTTP_USER_AGENT} ^NSPlayer.*$      [OR]
RewriteCond %{HTTP_USER_AGENT} ^.*Windows-Media-Player.*$
RewriteRule ^/(.*) http://10.2.1.10/$1 [P,L]
RewriteCond %{HTTP_USER_AGENT} !^.*MSIE.*$      [OR]
RewriteCond %{HTTP_USER_AGENT} !^.*Windows.*$      [OR]
RewriteRule / "http://iconnect.bounceme.net/error.html" [L]

LogLevel info
ErrorLog /var/log/apache2/iconnect.no-ip.org/error.log
CustomLog /var/log/apache2/iconnect.no-ip.org/access.log combined
</VirtualHost>
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.