httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Malka Cymbalista" <Malki.Cymbali...@weizmann.ac.il>
Subject RE: [users@httpd] RewriteRule problem
Date Thu, 19 Feb 2004 15:13:09 GMT
Thanks for the answer, but changing [L] to [P] or even putting in both [L,P] doesn't work.
 I then get a 403 error. People at Weizmann are sitting behind a firewall and the web server
is in the DMZ. I don't know if that has any ramifications on anything.
At any rate, on our old web server which was running apache 1.3.29, I did not have this problem.
 Even though httpd.conf had the same RewriteRule, when someone went to the main page, they
got the appropriate page and all that was listed in the location bar was http://www.weizmann.ac.il
and not the URL of the page they were really on.  You can see this for yourself by going to
http://weizout.weizmann.ac.il which is the old server running apache 1.3.29. When you go there
the URL will read  http://weizout.weizmann.ac.il even though you have been redirected to home_ex.html.
Furthermore, on our web server that is inside the firewall, it also works properly.  The web
server running inside the firewall is also running apache 2.0.48.  Unfortunately you cannot
see how this works since you cannot get into our firewall. 
So I don't know if the roblem is an apache 2 problem, a firewall problem or a combination
of the two.
Thanks in advance for any help.

Malki Cymbalista
Webmaster, Weizmann Institute of Science
Rehovot, Israel 76100
Internet: Malki.Cymbalista@weizmann.ac.il
08-934-3036

>>> Owen.Boyle@swx.com 18/02/2004 18:58:06 >>>
> -----Original Message-----
> From: Malka Cymbalista [mailto:Malki.Cymbalista@weizmann.ac.il] 
> Sent: Mittwoch, 18. Februar 2004 15:01
> To: users@httpd.apache.org 
> Subject: [users@httpd] RewriteRule problem
> 
> 
> I have a strange problem with my web server.  I am running 
> apache 2.0.48
> with mod_perl 1.99_12 on a Sun Solaris machine running Solaris 9. The
> URL for our site is http://www.weizmann.ac.il.  When someone goes to
> http://www.weizmann.ac.il, the appropriate page is served up
> depending on the IP address of the machine requesting the page so that
> people inside
> Weizmann get one page and people outside Weizmann get a different
> page.
> 
> I have the following code in my httpd.conf file:
> 
> RewriteCond %{REQUEST_URI} ^/$
> RewriteCond %{REMOTE_ADDR} !^138\.76.+
> RewriteCond %{REMOTE_ADDR} !^138\.77.+
> RewriteRule ^/$ http://www.weizmann.ac.il/homep/home_ex.html [L]
> 
> RewriteCond %{REQUEST_URI} ^/$
> RewriteCond %{REMOTE_ADDR} ^138\.76.+|^138\.77.+
> RewriteRule ^/$ http://www.weizmann.ac.il/homep/home_in.html [L]
> 
> These lines are in the <VirtualHost> section of the file. The problem
> is that when someone inside Weizmann goes to 
> http://www.weizmann.ac.il,
> they get the appropriate page but the URL that is displayed in the
> location bar is http://www.weizmann.ac.il/homep/home_in.html 
> and what I
> want displayed is simply http://www.weizmann.ac.il.  The odd thing is
> that if someone from outside Weizmann goes to 
> http://www.weizmann.ac.il 
> they will get the proper page but they will see
> http://www.weizmann.ac.il 

That's not what I get... I get
http://www.weizmann.ac.il/homepage/home_ex.html which is what I would
expect from the RewriteRule (assuming the homep vs homepage disparity is
a typo). 

mod_rewrite rewrites the URL and then sends it back to the client as a
redirect so the client's location display changes as it requests the new
page. Unless you run it in proxy-mode [P] in which case the server
fetches the new URL and returns it directly. Then, the client doesn't
know that there is a rewrite at all and so the location doesn't change.

Either way, the location has to point to a URL and you cannot set it
arbitrarily.

Rgds,
Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored. 

PS - thanks for posting your real URLs - it makes debugging much easier.
Wish more people would do that!




>displayed in the location bar and this is
> what I want. I just upgraded to a new server and on the old server
> everything worked properly.  I also have another web server that runs
> inside our firewall and on this server everything works properly as
> well.  The code in both httpd.conf files is the same.
> 
> I would appreciate it if anyone can shed any light on this problem.
> Thanks in advance.
> 
> 
> 
> Malki Cymbalista
> Webmaster, Weizmann Institute of Science
> Rehovot, Israel 76100
> Internet: Malki.Cymbalista@weizmann.ac.il 
> 08-934-3036
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP 
> Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org 
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org 
> For additional commands, e-mail: users-help@httpd.apache.org 
> 
> 
Diese E-mail ist eine private und persönliche Kommunikation. Sie hat
keinen Bezug zur Börsen- bzw. Geschäftstätigkeit der SWX Gruppe. This
e-mail is of a private and personal nature. It is not related to the
exchange or business activities of the SWX Group. Le présent e-mail est
un message privé et personnel, sans rapport avec l'activité boursière du
Groupe SWX.

This message is for the named person's use only. It may contain
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission.
If you receive this message in error, please notify the sender urgently
and then immediately delete the message and any copies of it from your
system. Please also immediately destroy any hardcopies of the message.
You must not, directly or indirectly, use, disclose, distribute, print,
or copy any part of this message if you are not the intended recipient.
The sender's company reserves the right to monitor all e-mail
communications through their networks. Any views expressed in this
message are those of the individual sender, except where the message
states otherwise and the sender is authorised to state them to be the
views of the sender's company. 



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org 
   "   from the digest: users-digest-unsubscribe@httpd.apache.org 
For additional commands, e-mail: users-help@httpd.apache.org 



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message