This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: Regex question
Author
Message |
Jax
Newbie


Joined: 28 April 2011
Posts: 1
Posted: 28 April 2011 at 3:36am

Hello

I'm using ISAPI_Rewrite version 2.13 build 71 for Url rewriting. It is not a trial version. 

With these settings:

[ISAPI_Rewrite]

## General Settings ##
CacheClockRate 3600

RepeatLimit 32

# Block external access to the httpd.ini and httpd.parse.errors files
RewriteRule /httpd(?:\.ini|\.parse\.errors).* / [F,I,O]
# Block external access to the Helper ISAPI Extension
RewriteRule .*\.isrwhlp / [F,I,O]

I have the following RewriteRule defined:

RewriteRule /www.test.com/folder/([\-\w\d\+]+)/([\w\d\+\$\%\-\_\.\!\*\'\(\)\,\/]*)/([0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}).html$ /www.test.com/folder/page.htm?s=$1&p=$2&id=$3 [I,L]

to catch the following url:

/www.test.com/folder/ab/test1/test2/dfeb2b2b-fca5-4592-93cd-4841afb28462.html

When I from my application try to access the p param from the querystring it doesn't contain the whole path. Only until the first forward slash. e.g. contains p=test1 and not p=test1/test2 as I would like. I would like to capture the whole path so I can do valiation on the query string.

Using the provided test regex utility it seems the regex should be alright.

Do you have any suggestions why this doesn't work?

Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 28 April 2011 at 4:08am

Although your rule seemed to work fine, I've simplified it a bit:

RewriteRule /www.test.com/folder/([^/]+)/(.*)/([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})\.html
/www.test.com/folder/page.htm\?s=$1&p=$2&id=$3 [I,L]

Could you show the resulting URL you obtain when testing. And what is the exact request you make?

__________________
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