tags:

views:

20

answers:

1

HI:

I'm trying to assign by default a RewriteBase / directive for every folder under docroot folder.

Do you know how to do it ?

I've tried using a

<Directory "/docroot/*">RewriteBase *</Directory> 

but obviously it doesn't work.

Thank yoU !

A: 

Try <DirectoryMatch> instead:

<DirectoryMatch "^/docroot/">
    RewriteBase /
</DirectoryMatch>

Note that <DirectoryMatch> is only allowed in the server configuration and virtual host context.

Gumbo
thank you for your answer. Do you know how to set a custom rewritebase for every folder, based in their folder name, for example, rewritebase /folder1/ for directory folder1, rewritebase /fodler2/ for /folder2 and so on ?
@user365877: That’s the default: “The default setting is; `RewriteBase physical-directory-path`” (see [`RewriteBase` directive](http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritebase)).
Gumbo