Forum Moderators: phranque

Message Too Old, No Replies

rewrite?

         

charkol

2:58 pm on Sep 22, 2007 (gmt 0)

10+ Year Member



i think i'll just spew out what im trying to achieve and see where it gets me.

I have a few workstations that arn't allowed to access any websites, instead their request are meant to be forwarded to an internal webserver and a default "Sorry you cant use the internet" page is displayed.

When they try to connect to an external webserver on either port 80 or 443 the firewall forwards the request to our apache server no problem.

Our apache conf has the following added;

RewriteEngine On
rewriteRule ^(.*) [intranet.foobar.local...] [R=302,L]

But if a client requests for example; [foo.bar...]
instead of getting; [intranet.foobar.local...] we get a 404: page not found.

apache logs say;
[23/Sep/2007:01:27:24 +0930] "GET /docs/282818.htm HTTP/1.1" 404 308

Am i on the right track?

It's getting late, 1am in the morning, i need some help.

[edited by: charkol at 3:10 pm (utc) on Sep. 22, 2007]

charkol

3:06 pm on Sep 22, 2007 (gmt 0)

10+ Year Member



forgot to mention that is a client requests [foo.bar...] it works. but when they request [foo.bar...] they gert the 404.

jdMorgan

4:19 pm on Sep 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Since foo.bar/docs/282818.htm is a different hostname than intranet.foobar.local/intranet/index.html, it;s not at all clear how or why you expect the rules on intranet.foobar.local to have nay effect on requests for foo.bar.

However, it is still likely that your problem lies within whatever mechanism you may be using to establish the relationship you seem to imply between those two different hostnames, whether is it a reverse-proxy, Alias directive, DNS CNAME, or some other mechanism.

Jim

charkol

9:58 pm on Sep 22, 2007 (gmt 0)

10+ Year Member



I believe the hostname is being ignored in my situation because if on the test machine i type [google.com.au...] i actually get [google.com.au...] which my apache server displays no problems.

But if i type [google.com.au...] for example it seems to try and find somewhere.php in my document root, which obviously doesn't exsist.

How do i rewrite EVERYTHING after address.com/ to be my sorry.html?