We are moving a site from an old cms to drupal and need the regex url rewrite/redirect statements to handle the following.
(1. Incoming url contains a ",")
[login to view URL],3458,0,0,1,0
rewrites & redirects to [login to view URL]
(2. The word following "?" is found in a mapped list and the backreference is used.)
[login to view URL]
rewrites & redirects to [login to view URL]
(3. The word following the "?" is found but cannot be used as a backreference.)
[login to view URL]
rewrites & redirects to [login to view URL]
All 3 expressions may have to be applied. If a url contains a comma the first expression is executed and the rule applications stop. If no comma is present the second rule is tested against a map of terms. If no match is found then the third rule is tested against a second map of terms. If no match is found a page-not-found error is returned.
We have used 1 single map in a similar way with the following code:
IN [login to view URL]:
RewriteMap rwmap dbm:/home/clientid/rewrite/[login to view URL]
IN .HTACCESS:
RewriteEngine On
RewriteCond ${rwmap:$1} >""
RewriteRule (.*)(.html)$ ${rwmap:$1}
To be clear:
Urls with a comma can use the backreference to create the rw/rd, as an terms found in the first map. Urls not found by the 1st or 2nd expressions will be manually mapped by listing both the originating url and the rw/rd url. We anticipate the map files to be large and we will manually assemble them.