Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 312
  • Last Modified:

Redirects not working...any ideas?

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
Yashy
Asked:
Yashy
  • 2
  • 2
1 Solution
 
Easwaran ParamasivamCommented:
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
 
YashyAuthor Commented:
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
 
Easwaran ParamasivamCommented:
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
 
YashyAuthor Commented:
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now