This seems like a very simple question.

I tried putting a RewriteMap directive in an .htaccess file but the logs showed an alert:

RewriteMap not allowed here

Then I tried putting it in the VirtualHost declaration in the apache2/sites-available file, but reloading apache gives me:

RewriteMap not allowed here
...fail!

In both cases with RewriteEngine on.

Is this referring to the location of the actual map on the file system, or the RewriteMap directive?

Just in case it helps:

<VirtualHost *:80>
  ServerName localhost
  etc...
  <Directory /var/www/site>
  AllowOverride all
  Options Indexes FollowSymLinks MultiViews
  Order allow,deny
  Allow from 127.0.0.1
  RewriteEngine On
  RewriteMap map txt:/var/www/site/map.txt
  RewriteRule /path/[^/]+/([^/]+) ${map:$1} 
  etc...
link|improve this question
feedback

1 Answer

up vote 1 down vote accepted

According to the official documentation it's only allowed in the scope (Context: in the infobox) of server config, virtual host. Place it outside the directory directive and it will work.

link|improve this answer
Thanks for the very quick reply! – lazysoundsystem Aug 13 '10 at 14:20
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.