开发者

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

开发者 https://www.devze.com 2023-02-10 11:16 出处:网络
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:

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 appreci开发者_高级运维ate 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...


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

0

精彩评论

暂无评论...
验证码 换一张
取 消