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
Message |

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


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

With these settings:


## 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 /[\-\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$ /$1&p=$2&id=$3 [I,L]

to catch the following url:


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
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 /[^/]+)/(.*)/([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
/\?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?

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