Solved

Redirects not working...any ideas?

Posted on 2012-03-19
4
301 Views
Last Modified: 2012-03-19
Hi guys,

We're using IIS7.

We need to redirect http://www.domain.com/one/two/three/four?addFilter=five&filterValue=six seven

to http://www.domain.com/four/six-seven?showproducts=true

Having problems with the whitespace %20 on URL between six and seven
<rule name="PatternRedirect" stopProcessing="true">
          <match url="one/two/three/four.*" />
          <conditions trackAllCaptures="true">
                        <add input="{QUERY_STRING}" pattern="filterValue=([a-z]+)\s*([a-z]+)" />
                        <add input="{HTTP_HOST}" pattern="domain.com$" />
          </conditions>
 <action type="Redirect" url="http://domain.com/womens/{C:1}-{C:2}" redirectType="Permanent" />
        </rule>


Tried \s* and [\s*] and (%20|\s*) none seem to work,

Any ideas?

Thanks
Yashy
0
Comment
Question by:Yashy
  • 2
  • 2
4 Comments
 
LVL 16

Expert Comment

by:Easwaran Paramasivam
ID: 37737185
0
 
LVL 1

Author Comment

by:Yashy
ID: 37737261
There's no option to change the querying string. These links are out there and therefore we need to work out a way to ccapture six and seven as separate parameters and then use them to redirect to the target/ destination Url as in the above example.

tried to use \s* or %20 but neither seem to work. Any suggestions?
0
 
LVL 16

Accepted Solution

by:
Easwaran Paramasivam earned 500 total points
ID: 37737490
Try pattern with group:
filterValue=([a-z]*)\s([a-z]*)

Open in new window

Without group:
filterValue=[a-z]*\s[a-z]*

Open in new window

0
 
LVL 1

Author Comment

by:Yashy
ID: 37737684
It ended up being the ordering of the patterns. One pattern was kicking in before the other and causing a problem with the redirect. The ordering has now been changed again.

Thanks for your help dude.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

809 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