I have to Rewrite massive number of URLs e.g: FROM: http://www.lespoulettes-bijoux.fr/produit2.asp?id_produit=8489 TO: http://www.lespoulettes-bijoux.fr/colliers-femme-createur-fantaisie/femme-collier-ras-de-cou-fils-d-argent-et-6-perles-blanches-et-grises-10005.html
So I selected to do a RewriteMap cause my URL doesn't have the same ID to match with.
So I declared my RewriteMap who is loking like that:
8489 http://www.lespoulettes-bijoux.fr/colliers-femme-createur-fantaisie/femme-collier-ras-de-cou-fils-d-argent-et-6-perles-blanches-et-grises-10005.html
In my .htacess: I wanted to convert my URL to transform my GET parameter (id_produit) into an interal id to git it after in my ReWriteMap.
The Problem: I have An Error 500 while converting my URL and I dont know the right syntax to switch after convert it:
RewriteEngine on
RewriteCond %{QUERY_STRING} ^id_produit\=(.+)$
RewriteRule (.*) /$1/id=%1 <== HERE 500 Internal Server Error
#RewriteRule ^/id_produit.asp/(.*)$ ${map_product:$1} [R]
To resume: I want to switch 'www.exemple.com/produit2.asp?id_produit=8489' into www.exemple.com/produit2.asp/id=8489 and send the id to my RewriteMap to redirect to the Right URL.
Thanks for your help!
I almost have the solution:
Redirect me into my map but add /var/www/les-poulettes-bijoux/ in the middle of my URL:
/produit2.asp?id_produit=8489 => http://www.lespoulettes-bijoux.fr/var/www/les-poulettes-bijoux/colliers-femme-createur-fantaisie/femme-collier-ras-de-cou-fils-d-argent-et-6-perles-blanches-et-grises-10005.html
But i need http://www.lespoulettes-bijoux.fr/colliers-femme-createur-fantaisie/femme-collier-ras-de-cou-fils-d-argent-et-6-perles-blanches-et-grises-10005.html
How can I delete that useless part in my URL?