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
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: Regex question Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
Jax
Newbie
Newbie


Joined: 28 April 2011
Online Status: Offline
Posts: 1
Posted: 28 April 2011 at 3:36am | IP Logged Quote Jax

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 View Jax's Profile Search for other posts by Jax
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10520
Posted: 28 April 2011 at 4:08am | IP Logged Quote Anton

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 View Anton's Profile Search for other posts by Anton
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
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