Solved

iis 7 url rewrite problem

Posted on 2010-08-26
6
1,022 Views
Last Modified: 2012-05-10
i am trying to change too change this url
book.asp?SC=ABC5027#offer&rmid=SurvivalGuideE4&rrid=237952859
to move the anchor tag to the end.... like:
book.asp?SC=ABC5027&rmid=SurvivalGuideE4&rrid=237952859#offer

the rule we're trying is seems to test ok, but doesnt work in practice

     <rule name="Responsys#">
<match url="(.*landing/.*)#(.*?)&amp;(.+)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="{R:1}&amp;{R:3}#{R:2}" appendQueryString="false" logRewrittenUrl="false" />
         </rule>

0
Comment
Question by:jimwarrenus
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 40

Expert Comment

by:Richard Quadling
ID: 33543083
The URL in the form

book.asp?SC=ABC5027#offer&rmid=SurvivalGuideE4&rrid=237952859

is not valid in that the rmid and rrid elements are just part of the # fragment.

e.g.

php -r "var_dump(parse_url('book.asp?SC=ABC5027#offer&rmid=SurvivalGuideE4&rrid=237952859'));"
array(3) {
  ["path"]=>
  string(8) "book.asp"
  ["query"]=>
  string(10) "SC=ABC5027"
  ["fragment"]=>
  string(41) "offer&rmid=SurvivalGuideE4&rrid=237952859"
}

What is generating it?

So, the part of the query that IIS will get to play with is ...

book.asp?SC=ABC5027

If you set the appendQueryString option, it will just append it again.

Also, you are requiring the URL to contain landing/

Something that the url you've supplied doesn't contain.

I'm using IIS7.

Below is a screen shot ...

What is generating the URL?

Is it an AJAX call and are you just appending the values without splitting out the #fragment?


TestPattern.png
0
 

Author Comment

by:jimwarrenus
ID: 33544283
you're right ... i left off the /landing
 
take a look at the attached screenshot....
landing/book/book.asp?SC=ABC5027#offer&rmid=SurvivalGuideE4&rrid=237952859
thanks, jim

ScreenShot237.jpg
0
 
LVL 40

Expert Comment

by:Richard Quadling
ID: 33544986
And now using ...



I don't think you need to escape &, so & and not &amp;
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

Author Comment

by:jimwarrenus
ID: 33553746
hmmm, when i remove the amp; i get this error
 
HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid.
Config Source 13: <rule name="Responsys#"> 14: <match url="(.*landing/.*)#(.*?)&(.+)" /> 15: <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />  
0
 
LVL 40

Expert Comment

by:Richard Quadling
ID: 33554481
I'll take a look when I get back in the office on Tuesday. No IIS available from home.
0
 

Accepted Solution

by:
jimwarrenus earned 0 total points
ID: 33592335
it looks like the rewrite module stops at the # sign......   we gave up on that approach and used some redirect code instead...
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Debug Tools to analyse IIS process: This article focus on taking memory dumps from IIS to determine which code is taking more time and to analyse which calls hangs/causes more CPU usage. To take dumps,download the following. Install1: To st…
Lync server 2013 or Skype for business Backup Service Error ID 4049 – After File Share Migration
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…
Suggested Courses

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question