On Thu, Aug 10, 2006 at 08:38:32PM -0400, Joshua Slive wrote:
> On 8/10/06, Bill Moseley <[EMAIL PROTECTED]> wrote:
> >I suppose the simple way is the following:
> >
> >        RewriteCond %{REQUEST_URI} \.(jpe?g|gif|png|txt|doc|ppt|pdf)$
> >        RewriteCond %{REQUEST_URI} !/css/
> >        RewriteCond %{REQUEST_URI} ^/Rural                  [nocase]
> >        RewriteRule ^/(?:Rural/)?(.+)$ /domains/Rural/$1    [last,nocase]
> >
> >        # now non-rural, do the same.
> >
> >        RewriteCond %{REQUEST_URI} \.(jpe?g|gif|png|txt|doc|ppt|pdf)$
> >        RewriteCond %{REQUEST_URI} !/css/
> >        RewriteRule ^/(.+)$ /domains/default/$1             [last]
> 
> RewriteConds apply only to the RewriteRule immediately following them.
> There are various ways to avoid having to write the same conds
> multiple times, for example:
> RewriteCond %{REQUEST_URI} !\.(jpe?g|gif|png|txt|doc|ppt|pdf)$
> RewriteCond %{REQUEST_URI} ^/css/
> RewriteRule .* - [L]
> 
> RewriteRule ^/(.+)$ /domains/default/$1             [last]
> RewriteRule ^/(?:Rural/)?(.+)$ /domains/Rural/$1    [last,nocase]

I see.  I was thinking the Skip feature wouldn't really count. ;)

I build the httpd.conf with templates so it's not much problem
repeating.

I also realized that only .html needs to get proxied to my backend,
so I can just look for any files with an extension that doesn't end
in .html:

        RewriteCond %{REQUEST_URI} !/css/
        RewriteCond %{REQUEST_URI} \.\w+$
        RewriteCond %{REQUEST_URI} !\.html$
        RewriteRule ^/(.+)$ /domains/default/$1             [last]

Thanks!

-- 
Bill Moseley
[EMAIL PROTECTED]


---------------------------------------------------------------------
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: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to