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: Rewrite Rule
Author
Message |
claytonwagner
Newbie


Joined: 09 September 2010
Location: United States
Posts: 3
Posted: 09 September 2010 at 12:27pm

I'm having a problem with a rewrite rule. I've been working on it for quite a while and need some assistance.

Request URL

http://domainname/terms.html?page=27

Rewrite URL

http://domainname/default.aspx?/page=27&html=terms.html

RewriteRule /(.*\.html)\?page=([^?]*)  /default.aspx\?/$2&html=$1 [I,O,L]

This is the rule I wrote and I believe it should work, but I'm getting invalid match. Can someone have a look and tell me what I'm doing wrong.

Thank you

Back to Top Visit claytonwagner's Homepage
 
claytonwagner
Newbie


Joined: 09 September 2010
Location: United States
Posts: 3
Posted: 09 September 2010 at 12:29pm

Sorry... this is my rule.

RewriteRule /(.*\.html)\?page=([^?]*)  /default.aspx\?/page=$2&html=$1 [I,O,L]

Back to Top Visit claytonwagner's Homepage
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 10 September 2010 at 5:09am

Please try this:

RewriteRule /([^.]+)\.html\?page=([^?]+) /default\.aspx\?/page=$2&html=$1\.html [I,O,L]

Regards
Andrew
Back to Top
 
claytonwagner
Newbie


Joined: 09 September 2010
Location: United States
Posts: 3
Posted: 10 September 2010 at 11:20am

When I put that into the RegexTest, I get "Pattern Not matched". this is exactly what is in those fields.

Regexp = /([^.]+)\.html\?page=([^?]+)

Test String = /terms.html?page=27

format string = /default\.aspx\?/page=$2&html=$1\.html

Any thoughts why this does not match the pattern? Thank you for your reply!

Back to Top Visit claytonwagner's Homepage
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 13 September 2010 at 8:57am

Do you use RegexTest for v2 or for v3?
Have you tested this rule on the site not in tester?

__________________
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