Afficher un message
Vieux 24/05/2006, 02h10   #1
blaq@blaqzone.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Can I redirect SSI's in a manner similar to mod_rewrite?

I have authored several Web sites (let's call them site1.com,
site2.com...) that make liberal use of SSI includes for things like
headers, etc. Most pages contain the following:

<!--#include virtual="/includes/header.html" -->

Now, I am trying to set up a temp copy of those sites to serve as
staging areas when I make changes, so I don't play around with the live
sites. They are stored under my server root at (let's call it
myuser.com), in the Temp directory:

/ [myuser.com server root]
Temp
site1
includes
images
etc.
site2
includes
images
etc.

Problem: pages in each staging site now try to include files from the
wrong directory. For example, let's take the live page:

site.com/index.html

whose include resolves to

site.com/includes/header.html



The staging version of that page, located at

myuser.com/Temp/site1/index.html

will want to include /includes/header.html which resolves to

myuser.com/includes/header.html

I want it to resolve to

myuser.com/Temp/site1/includes/header.html



If these were files requested by users' browsers, I could use the
Apache rewrite engine to point the requests to the right directory.
However, because the problem lies with server-side includes, I can't do
that, right? (If I can, then I screwed up because it didn't seem to
work.)

So, is there a way in Apache for the server to modify the URL of
#included files, so that I can keep the HTML code on the staging sites
identical to that found on the live sites?

P.S. I can't simply set up a link to /Temp/site1/includes/ from
/includes , as each staging site has its own /includes directory --
linking the root's /includes to one staging site's correct directory
would not solve the problem for the remaining staging sites.

Thanks for your .

  Réponse avec citation
 
Page generated in 0,05480 seconds with 9 queries