Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

iis 7 url rewrite problem

Posted on 2010-08-26
6
Medium Priority
?
1,025 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Here are the symptoms: You start receiving calls from users that one of your legacy web apps isn't coming up, so you log into your IIS 5 server to check it out.  When you pull up the services, you notice that the WWW Publishing service isn't runn…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

704 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