5

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'm getting a 500 Internal Server Error when the page in question is hit.

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 wish for it to be rewritten as follows.

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

should be rewritten like this

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

Any thoughts?

unor
  • 92,415
  • 26
  • 211
  • 360
Vibration Of Life
  • 3,177
  • 3
  • 22
  • 23
  • You could just use a relative path, so just txt:key_pair.txt. No other thoughts as to what might be causing the problem. – Gerben Oct 31 '11 at 19:22
  • Well it looks the site isn't accessible with the RewriteMap rule. I just tested other pages and can't access any of them. ONce i comment out the lines from the .htaccess file the site runs. – Vibration Of Life Oct 31 '11 at 19:39
  • I wonder if the RewriteMap goes in the .htacess file or somewhere else. – Vibration Of Life Oct 31 '11 at 19:46

1 Answers1

9

You can't have RewriteMap in an .htaccess file:

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

Only usable in server config (like httpd.conf) and your virtual host conf files.

Jon Lin
  • 142,182
  • 29
  • 220
  • 220