Solved

iis 7 url rewrite problem

Posted on 2010-08-26
6
1,012 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
  • 3
  • 3
6 Comments
 
LVL 40

Expert Comment

by:RQuadling
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:RQuadling
ID: 33544986
And now using ...



I don't think you need to escape &, so & and not &amp;
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

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:RQuadling
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Lync server 2013 Backup Service Error ID 4049 – After File Share Migration
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now