Click Fraud Protection
PHP related blog, freelancer to hire!

RewriteMap causing indefinite redirects

If you’re using Apache mod_rewrite with RewriteMap is causing loop and breaks, probably you had forget about conditions.

RewriteMap  links txt:/var/www/bin/rewritemap.txt
RewriteCond ${links:$1|Unknown} !Unknown
RewriteRule ^/(.*) ${links:$1} [R=301,L,NC]

Easy saying – Rule will redirect only when url is found in your mapfile


Leave a Reply