500 error when I have a RewriteMap in .htaccess

I have a map file in this format

233 Alabama/Phenix-City/Ridgebrook 237 Alabama/Ft.-Mitchell/Riverside-Estates 

I have the following .htaccess script. I get a 500 Internal Server Error when the page in question hits.

 RewriteEngine On RewriteBase / Options +FollowSymLinks RewriteMap examplemap txt:/var/www/html/site.com/key_pair.txt RewriteRule community.php?(.*) ${examplemap:$1} [R] 

When I pass the following URL, I want it to be rewritten as follows.

 http://example.com/community.php?comm_id=233 

should be rewritten as follows

 http://example.com/Alabama/Phenix-City/Ridgebrook 

Any thoughts?

+4
source share
1 answer

You cannot have a RewriteMap in the .htaccess file:

http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritemap

Used only in the server configuration (for example, httpd.conf) and in the conf files of your virtual host.

+7
source

Source: https://habr.com/ru/post/1379012/


All Articles