This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
Common Questions (Forum Locked Forum Locked)
 Helicon Tech : Common Questions
Subject Topic: Urgent Help - Regex Newbie - $10, $11??
Author
Message |
jaypeezie
Newbie


Joined: 17 May 2009
Location: United Kingdom
Posts: 3
Posted: 17 June 2009 at 12:17pm

Hi,

I have the following rules which works pretty well but only for those URLs that only have 9 words or less, otherwise it adds a 0 to the 10th word, 1 to the 11th word, 2 to the 12th word and so on:

RewriteRule ^weblog/permalink/(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)/ /blog/($1)-($2)-($3)-($4)-($5)-($6)-($7)-($8)-($9)-($10)-($11)-($12)-($13)/ [R=301,NC,L]
RewriteRule ^weblog/permalink/(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)/ /blog/($1)-($2)-($3)-($4)-($5)-($6)-($7)-($8)-($9)-($10)-($11)-($12)/ [R=301,NC,L]
RewriteRule ^weblog/permalink/(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)/ /blog/($1)-($2)-($3)-($4)-($5)-($6)-($7)-($8)-($9)-($10)-($11)/ [R=301,NC,L]
RewriteRule ^weblog/permalink/(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)/ /blog/($1)-($2)-($3)-($4)-($5)-($6)-($7)-($8)-($9)-($\10)/ [R=301,NC,L]
RewriteRule ^weblog/permalink/(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)/ /blog/($1)-($2)-($3)-($4)-($5)-($6)-($7)-($8)-($9)/ [R=301,NC,L]
RewriteRule ^weblog/permalink/(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)/ /blog/($1)-($2)-($3)-($4)-($5)-($6)-($7)-($8)/ [R=301,NC,L]
RewriteRule ^weblog/permalink/(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)/ /blog/($1)-($2)-($3)-($4)-($5)-($6)-($7)/ [R=301,NC,L]
RewriteRule ^weblog/permalink/(.*)_(.*)_(.*)_(.*)_(.*)_(.*)/ /blog/($1)-($2)-($3)-($4)-($5)-($6)/ [R=301,NC,L]
RewriteRule ^weblog/permalink/(.*)_(.*)_(.*)_(.*)_(.*)/ /blog/($1)-($2)-($3)-($4)-($5)/ [R=301,NC,L]
RewriteRule ^weblog/permalink/(.*)_(.*)_(.*)_(.*)/ /blog/($1)-($2)-($3)-($4)/ [R=301,NC,L]
RewriteRule ^weblog/permalink/(.*)_(.*)_(.*)/ /blog/($1)-($2)-($3)/ [R=301,NC,L]
RewriteRule ^weblog/permalink/(.*)_(.*)/ /blog/($1)-($2)/ [R=301,NC,L]

RewriteRule ^weblog/permalink/(.*)/ /blog/($1)/ [R=301,NC,L]

 

Is there a better way to do this?

Cheers,

JAY

Back to Top Visit jaypeezie's Homepage
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 18 June 2009 at 1:05am

ISAPI_Rewrite (as well as Apache) supports back references only from $0 to $9.
This limitation is planned to be eliminated in the next versions of ISAPI_Rewrite.

__________________
Regards,
Anton
Back to Top
 
pawlos
Newbie


Joined: 09 February 2010
Posts: 4
Posted: 09 February 2010 at 10:50am

Sorry for writing in an old topic but when one might expect that this limitation will be eliminated?

I'm running the 3.1.0.69 version and still have the same problem.

Regards,
Pawel
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 10 February 2010 at 3:32am

Sorry, but this is not a top priority task for us as we still tend to be Apache-compatible.
I can't promise it will be accomplished soon. The idea is still being discussed.

__________________
Regards,
Anton
Back to Top
 
pawlos
Newbie


Joined: 09 February 2010
Posts: 4
Posted: 10 February 2010 at 7:22am

Hi Anton,

Thanks for your answer. I'm just thinking why there is this limitation in the first place. You could have support more then 10 back references and still have 100% compatibility with Apache's mod_rewrite (you could have used different character before them or even with the same).
It's just artificial limitation you introduced that now needs dev time to be fixed - and of course there's always no time for those non-critical changes.

Regards,
Pawel
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 10 February 2010 at 9:05am

"It's just artificial limitation you introduced" - it's not we who introduced it. It's Apache...
I'll talk to our developers and they'll decide when they can do that.

__________________
Regards,
Anton
Back to Top
 
pawlos
Newbie


Joined: 09 February 2010
Posts: 4
Posted: 10 February 2010 at 9:14am

Hi Anton,

Ok, you wanted to be 100% compliant with Apache. You could have had that even with the support for more than 10 back references. You could have just use different character for back references above 9.

So the dev would use $0-$9 for first ten and the rules will be compatible with Apache's and if someone what to use 10th, 11th, ... they have to use for example @10,@11.

Regards,
Pawel

Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 11 February 2010 at 3:25am

We've discussed the issue, and I hope we'll implement it next week. I'll inform you as soon as it's done.

__________________
Regards,
Anton
Back to Top
 
pawlos
Newbie


Joined: 09 February 2010
Posts: 4
Posted: 11 February 2010 at 7:40am

Hi Anton,

Thanks for your reply. I've just one question. A friend of mine got an answer from your support that stated:

"
Hello,
Yes, you’re correct. ISAPI_Rewrite 2 can provide you with regular expression for the rest of parameters like $10, $11, $12 etc."

Is this true that ISAPI_Rewrite 2 supports more than 10 parameters but version 3 does not?

Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 11 February 2010 at 9:19am

"Is this true that ISAPI_Rewrite 2 supports more than 10 parameters but version 3 does not?" - yes, it's true.
So meanwhile you can try using it.

__________________
Regards,
Anton
Back to Top
 

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum