Score:0

How to write parameter URL in .htacess Rewrite

kz flag

I want to point this URL in .htaccess:

http://www.example.com/furniture/chair/foldingchair

to

http://www.example.com/products.asp?catID=1&SubID=2&SubCatID=3 

where

  • catID=1 = furniture
  • SubID=2 = chair
  • SubCatID=3 = foldingchair

every parameter have own name like

  • catid=1 furniture
  • Subid=4 table
  • subcatId=5 roundtable

but I have few hundreds of URL , so I need a single to that can work for all

RewriteRule furniture/chair/foldingchair/?$ products.asp?CatID=1&SubID=2&SubCatID=3
in flag
Sounds like a job for [RewriteMap](https://httpd.apache.org/docs/current/rewrite/rewritemap.html)
kz flag
...and `RewriteMap` requires access to the main server config in order to create the rewrite map initially - not something you can do in `.htaccess` only. Do all 3 parameters share the same ID-space (as they appear to in your 2 examples)? Or do you need 3 separate tables?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.