I have the following requirements for a site I'm building:
- For bureaucratic reasons, I have only one UNIX account, only one
subdomain, and no access to httpd.conf itself. (That may change, so if
you can think of a solution that would otherwise work, please post it!)
- I wish to have "system root" (my term) subdirectories /prod, /staging,
and /dev to hold the production site, ready-for-production, and
development versions of the site.
- The main content for each site is currently being generated by
MovableType, and will be stored in $SYSTEM_ROOT/mt-pages. (I don't like
having subsystem-specific files in the root directory.)
- Each site also uses other subsystems like vBulletin, a survey script,
etc., which are stored in $SYSTEM_ROOT/forum, $SYSTEM_ROOT/survey, etc.
- Requests for www.example.com/file.ext should be rewritten to
- Requests for any www.example.com/$SYSTEM_ROOT/file.ext should be
rewritten to $SYSTEM_ROOT/mt-pages/file.ext.
- BUT requests for www.example.com/$SYSTEM_ROOT/subdir/file.ext should
So far, so good. I have RewriteRules in an .htaccess in ServerRoot to
point it to prod, and similar rules in each $SYSTEM_ROOT dir to point
into mt-pages for any filename with a dot in it. (I'm OK limiting
myself to directories without dots.)
On 4/25/05, Jay Levitt <[hidden email]> wrote:
> Is there some solution with mod_rewrite, mod_alias, or something else
> that will let me rewrite both URLs and the content base? This seems
> like it ought to be a common problem.
From a quick read, I don't see any way to solve this problem without
rewriting all the URL references inside the pages you are sending.
That, in turn, is not an easy thing to do. But you can look at some
of Nick's modules: