This forum has been moved here:
Helicon Tech Community Forum

ISAPI_Rewrite 3.0 (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 3.0
Subject Topic: Problem with a particular Rewrite rule
Author
Message |
bjaffee
Newbie


Joined: 16 December 2011
Posts: 6
Posted: 05 March 2012 at 8:15pm

Hello.  I'm having an issue with a particular rewrite rule that checks out fine in the Regex tester, but does not seem to work in practice...

Here's the rule:

RewriteRule ^(.*)/(.+?)/overview/(p(\+|\s|%20)*[0-9]+)(\?(.+))?$ $1/Performer.aspx?mpp_tab=overview&performerId=$3&$6 [NC,L]

It's intended to match a URL that looks like this:
/johndoe/overview/p86295

The above works fine.  However, if you add a period to the end of the "johndoe" part (ex: /johndoejr./overview/p86295), it causes a 404 error.  If you run that string through the Helicon RegEx tester, it matches up just fine, though.

Is this a bug, or is there something I need to adjust in my rule?


Edited by bjaffee - 05 March 2012 at 8:20pm
Back to Top
 
HeliconA
Admin Group


Joined: 02 March 2012
Posts: 4142
Posted: 06 March 2012 at 6:05am

Hello,

RegExp in an old tool. Try using:

RewriteRule ^(.*)(/.+)?/overview/(p(\+|\s|%20)*[0-9]+)(\?(.+))?$ $1/Performer.aspx?mpp_tab=overview&performerId=$3&$6 [NC,L]

If the rule provided doesn't help, please, provide rewrite.log for the testing request.

Regards
Andrew
Back to Top
 
bjaffee
Newbie


Joined: 16 December 2011
Posts: 6
Posted: 06 March 2012 at 1:46pm

Andrew,

Partial success.  Your rule didn't quite work:
RewriteRule ^(.*)(/.+)?/overview/(p(\+|\s|%20)*[0-9]+)(\?(.+))?$ $1/Performer.aspx?mpp_tab=overview&performerId=$3&$6 [NC,L]

Trying the following URL, http://localhost/myserver/johndoe/overview/p86295,  when I look in the rewrite log, I see that it's trying to redirect here:
/myserver/johndoe/Performer.aspx?mpp_tab=overview&performerId=p86295& [INTERNAL REDIRECT]

As you can see, it's trying to pick up "johndoe" as though it's actually a real directory (which it is not).

I made a slight change to your suggested rule, placing the first slash back in it's original postion:
RewriteRule ^(.*)/(.+)?/overview/(p(\+|\s|%20)*[0-9]+)(\?(.+))?$ $1/Performer.aspx?mpp_tab=overview&performerId=$3&$6 [NC,L]

This seems to work, even with a period at the end of the name.  The same URL redirects to /myserver/Performer.aspx?mpp_tab=overview&performerId=p86295& as it should

Do you see anything wrong with this?

Also, what tool do you recommend using to test RegEx for Helicon?

Thanks for your help,

Brett

Back to Top
 
bjaffee
Newbie


Joined: 16 December 2011
Posts: 6
Posted: 06 March 2012 at 3:54pm

UPDATE:

I'm actually getting some inconsistent behavior that's making me think there's a bug Helicon surrounding this issue.  On one of my servers, I turned logging on at the highest verbosity setting, yet when I enter a URL with a period before a slash, I get 404 error, yet absolutely NOTHING in the log (and the redirection does not work, even with the updated rewrite rule).  If I enter a URL without a period before a slash, it logs it just fine. 

What's even more confusing is that on my local machine, I can now get the period-before-slash URLs to work, even using my original rewrite rule.

Also note: We were previously using ISAPI REWRITE v1 last year, with the same rewrite rules, and we had no issues with these particular URLS.  We didn't start seeing issues until we switched to v3.
Back to Top
 
HeliconA
Admin Group


Joined: 02 March 2012
Posts: 4142
Posted: 07 March 2012 at 6:11am

ISAPI_Rewrite v1??? Are you sure?
Do you have any additional software installed? PLESK, ColdFusion, etc?
Please, also make a check following this article.

We need more information about your environment.

Regards
Andrew
Back to Top
 
bjaffee
Newbie


Joined: 16 December 2011
Posts: 6
Posted: 07 March 2012 at 1:27pm

Well, 1 or 2.  As I said, we are currently on version 3 though.  No PLESK, no ColdFusion.  We are running .NET 4 on Windows Server 2008.

We have hundreds of rewrite rules, but this seems to be the only one giving us issues.


Edited by bjaffee - 07 March 2012 at 1:28pm
Back to Top
 

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

Printable version Printable version