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?
PHP Coding Timing Out If your PHP script makes external network connections, the connections may time out. If too many connections are attempted and time out, this will cause a "500 Internal Server Error." To prevent these time outs and errors, you'll want to make sure that PHP scripts be coded with some timeout rules.
htaccess, you can simply trigger a 500 directly: RewriteRule ^ - [R=500] . (In fact, any invalid syntax would do the job, eg crash ). You don't need the separate folder, you could make the error conditional in your main .
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With