Quantcast
Channel: URL Rewrite Module
Viewing all articles
Browse latest Browse all 2482

IIS rewrite rule w/ variable number of parameters

$
0
0

We're using this generic rule that works fine with Helicon APE (mod_rewrite-compatible) on Windows to handle friendly URLs and query strings with a variable amount of Parameters (0 - 5) using backreferences:


RewriteRule ^(.*)/\?(.+)$    $1/index.php\?$2
RewriteRule ^go/([^/]*)(?:/([^/]*)(?:/([^/]*)(?:/([^/]*))?)?)? /go.php\?friendlyURL=$1?4(&$2&$3&$4):(?3(&$2&$3):(?2(&$2):))  [L]
RewriteRule ^(de|en|fr|it|es|ja|jp|ru|nl|pt|pl|us|sv|da|cs|se|ar|cn)?/([^/]*)(?:/([^/]*)(?:/([^/]*)(?:/([^/]*))?)?)? /go.php\?lang=$1&friendlyURL=$2?5(&$3&$4&$5):(?4(&$3&$4):(?3(&$3):))
RewriteRule ^(DE|EN|FR|IT|ES|JA|JP|RU|NL|PT|PL|US|SV|DA|CS|SE|AR|CN)?/([^/]*)(?:/([^/]*)(?:/([^/]*)(?:/([^/]*))?)?)? /go.php\?lang=$1&friendlyURL=$2?5(&$3&$4&$5):(?4(&$3&$4):(?3(&$3):))

Converting/importing this rule into IIS Rewrite Module fails, the importer doesn't understand it correctly.

How can I implement this rule unter IIS Rewrite 2 ?


Viewing all articles
Browse latest Browse all 2482


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>