Moving from isapi_rewrite (win) to mod_rewrite (linux) problem

151 views Asked by At

I have been using isapi_rewrite on windows but am wanting to move over to linux / apache and have hit a problem with converting my existing rule. I'm after the following url rewrite:

Visitor / supplied sample url: *.php/param1/value1/param2/value/2/param3/value3/paramx/valuex

Matched to: whatever.php?value1=param1&param2=value2&param3=value3&paramx=valuex

I was previously using this rule in isapi_rewrite:

RewriteEngine on
RewriteRule ^(.*?\.php)/([^/]*)/([^/]*)(/.+)? $1$4?$2=$3 [NC,LP,QSA]

But LP (Loop) is not an apache mod_rewrite flag and i can't work out how to replace this rule with a suitable one in mod_rewrite.

The main thing is that the number of params/values is unknown so it needs to replace all ?, &, and = with /'s. I appreciate i could make the pattern a lot cleaner by removing the params and the file name but what i really want to do is get the app moved over to linux and working before making changes to how the application references links.

Thanks hopingly...

1

There are 1 answers

1
criticus On BEST ANSWER

You can use a flag 'next|N' to loop the rewriting process. See the mod_rewrite docs at apache.org.