RE: [users@httpd] Apache proxying

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Please don't change the "Reply To" field (you changed it so that replies go to you personally and not to the list. This defeats the purpose of the archive and wastes people's time if they post back on a thread that's already been answered).


> -----Original Message-----
> From: Anthony Browne [mailto:aabrowne@xxxxxxxxxxxx]
>
> 	I am trying to configure Apache to serve content from a local
> directory tree, if available, and proxy the request 
> otherwise. So far, these
> rules work to locate and serve the local material with the 
> desired response
> header:
> 
>  # this is turned off
> 	UseCanonicalName Off
> ...
> 	RewriteEngine On
> 	RewriteMap lowercase int:tolower
> 	RewriteCond  %{REQUEST_URI}  !^/error/ 
> 	RewriteRule ^/(.*)$ /webcontent/${lowercase:%{SERVER_NAME}}/$1
> 
> This configuration gets the local content, but other rules 
> I've tried after
> this have produced 404's such as:
> 
> 	RewriteCond  %{REQUEST_URI}  !-s

-s tests a filename. Like /home/web/dir/page.html. REQUEST_URI is the thing to the right of the domain name in the URL. Like /dir/page.html. So unless your docroot is "/", this will always be true (ie, the REQUEST_URI will never match a filepath).

> 	RewriteRule  %{REQUEST_ URI}
> ^http://${lowercase:%{SERVER_NAME}}/$(REQUEST_FILENAME) [P]

And what exactly does it say in the error_log? It will tell you the path that your compilcated rule is resolving to. Also you could switch on RewriteLog and see what it's doing.

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

> 
> Does anyone see where I'm going wrong? Suggested rules would help me a
> lot.Thanks.
> 
> 
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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux