Solved

Redirects not working...any ideas?

Posted on 2012-03-19
4
304 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
[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
  • 2
  • 2
4 Comments
 
LVL 16

Expert Comment

by:Easwaran Paramasivam
ID: 37737185
If space present in querysting that is wrong one.

Replace
http://www.domain.com/one/two/three/four?addFilter=five&filterValue=six seven

with

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

Please do refer below link.  http://stackoverflow.com/questions/5218452/passing-more-then-one-value-with-the-querystring-with-the-same-id
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

717 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