You probably could if you get real tricky with the regex code - but I would
say probably not. rewrite takes the entire url into consideration - so you
need to denote where to start with the rewrite base.
I use this for vufind:
RewriteRule ^([^/]+)/(.+)$ index.php?module=$1&action=$2 [L,QSA]
Which allows you to map:
So with that - you could capture all of the "directories" in the URL and
just remove anything that doesn't look familiar. But that is very hackish
since it could easily break and make it very difficult for someone to debug.
On Wed, Jul 1, 2009 at 9:20 AM, Godmar Back <[log in to unmask]> wrote:
> On Wed, Jul 1, 2009 at 9:13 AM, Peter Kiraly <[log in to unmask]> wrote:
> > From: "Godmar Back" <[log in to unmask]>
> >> is it possible to write this without hardwiring the RewriteBase in it?
> >> that it can be used, for instance, in an .htaccess file from within any
> >> /path?
> > Yes, you can put it into a .htaccess file, and the URL rewrite will
> > apply on that directory only.
> You misunderstood the question; let me rephrase it:
> Can I write a .htaccess file without specifying the path where the script
> will be located in RewriteBase?
> For instance, consider
> Here, anybody who wishes to use this code has to adapt the .htaccess file
> their path and change the "RewriteBase" entry.
> Is it possible to write a .htaccess file that works *no matter* where it is
> located, entirely based on where it is located relative to the Apache root
> or an Apache directory?
> - Godmar