I just ran into a bit of a conflict with Alias and Rewrite on my front
end.

Given that I have multiple virtual hosts serving up the same content
using a slightly different set of graphics and templates, the easy way
is to "Alias /_pageparts /real/page/parts/directory" and make the
alias different for each virtual host.  Then every document refers to
/_pageparts/XXX.yyy for the component it wants, and the proper one
based on the virtual host is used.

Something like this:

<VirtualHost 204.117.82.12>
  ServerName next.morebusiness.com
  RewriteEngine On
  RewriteOptions 'inherit'
  # handle GIF and JPG images directly
  RewriteRule \.(gif|jpg|png|css|txt|cgi)$ - [last]
  RewriteRule ^/cgi-bin - [last]
  # pass off everything but images to the heavy-weight server via proxy
  RewriteRule ^/(.*)$ http://localhost:4079/$1 [proxy]

  DocumentRoot /web/morebusiness/nextdocs

  Alias /_pageparts /web/morebusiness/nextdocs/_pageparts-default

</VirtualHost>

and on the back-end

Listen 4079
<VirtualHost localhost:4079>
  ServerName next.morebusiness.com
  Port 80

  DocumentRoot /web/morebusiness/nextdocs

  DirectoryIndex index.brc index.shtml index.html

  Alias /_pageparts /web/morebusiness/nextdocs/_pageparts-default
</VirtualHost>

One of the objects inside _pageparts-default is PAGEFOOT.shtml.  If I
do a 

lynx -source 'http://next.morebusiness.com/_pageparts-default/PAGEFOOT.shtml'

The page comes across fine.  If I do

lynx -source 'http://next.morebusiness.com/_pageparts/PAGEFOOT.shtml'

I get the page dumped raw.  That is, the SSI constructs are ignored.

If I enable .shtml files to be server-parsed on the front-end server,
then both return the processed result.  This is my work-around.

This leads me to believe that the Rewrite engine is ignored when an
Alias kicks in, otherwise the *.shtml files would be bounced back to
the back-end server where they get properly expanded.  Normally, this
is ok for me since everything else in the aliased directory is an
image which I want the front end to handle.

Has this bitten anyone else?  Stas, I think you should mention this in
the guide somehow as something to watch out for when using the proxy
front-end.  The Rewrite rules are ignored when an Alias expands the
URI, or so it seems from where I sit.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.                Khera Communications, Inc.
Internet: [EMAIL PROTECTED]       Rockville, MD       +1-301-545-6996
PGP & MIME spoken here            http://www.kciLink.com/home/khera/

Reply via email to