mod_rewrite RewriteMap issue

Soldato
Joined
16 Dec 2003
Posts
2,697
I'm a beginner with mod_rewrite and I'm struggling with trying to get the RewriteMap feature working on a website I'm developing. It seems to cause the website to get stuck in an infinite loop regardless of which page I'm on. Below is a snippet of the .htacess file:

Code:
RewriteMap url_rewritemap txt:/productmap.txt
RewriteCond ${url_rewritemap:$1}  >"" # RewriteMap not empty
RewriteRule ^(.*) /product.asp?ID=${url_rewritemap:$1} [R=301,L]

Below is an example snippet of the productmap.txt file:

Code:
##
## productmap.txt - Product to ID map file
##
 
0001 manufacturer-product-name-(product-code)-example1
0002 manufacturer-product-name-(product-code)-example2

What I'm trying to do with the mod_rewrite code is to rewrite the following example URL from a product map text file:

Code:
http://domainname.com/product.asp?ID=0001

to:

Code:
http://domainname.com/manufacturer-product-name-(product-code)-example1

Does anyone have any ideas on what is causing the infinite loop? :(
 
Back
Top Bottom