Solved

Need to rewrite a URL using Url Rewrite in IIS7

Posted on 2011-09-16
4
370 Views
Last Modified: 2012-05-12
I have a url in the database that appends an aspx page. Since the DB does not want to see a ? or = sign I need to use URL rewrite in IIS7. Having a problem doing so...

WebForm1.aspx?ID=   is what I need to come out of the URL rewrite

what I have in the DB is WebForm1.aspx/ID/

the pattern we are using is
WebForm1.aspx/([^/]+)/([^/]+)/?$

and the rewrite URL: is
WebForm1.aspx?{R:1}={R:2}

kind of a hurry on this one...
Thanks!
0
Comment
Question by:md0333
  • 3
4 Comments
 
LVL 13

Expert Comment

by:themrrobert
ID: 36550768
take a look here, I am not an expert in IIS rewrites, and am stepping out momentarily, but this should give you a headstart:
http://learn.iis.net/page.aspx/498/rule-with-rewrite-map---rule-template/

There are other templates you may use which may also be beneficial, the home page for this is:

http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/
0
 
LVL 13

Accepted Solution

by:
themrrobert earned 500 total points
ID: 36550776
0
 

Author Comment

by:md0333
ID: 36550807
yeah... we've looked at those. It's like the URL rewrite is just deleting what we are trying to change from the URL completely.

For example if you view source of the page after we try to run it it shows


ServerName/3880

When it shoud say

ServerName/WebForm1.aspx?ID=3880

So it looks like everything we are trying to do the URL rewrite on is just being omitted...
0
 
LVL 13

Expert Comment

by:themrrobert
ID: 36550882
from what you said i think you need

ServerName/WebForm1.aspx/id/3380

should translate into

ServerName/WebForm1.aspx?id=3380,

is that not correct?

rule should be:

^WebForm1/([_0-9a-z-]+)/([0-9]+)

rewritten to:

WebForm1.aspx?{R:1}={R:2}

try using that, i'm sure you probably already have.

also try to uncheck the "append query string" box and change Temporary to permanent.

I am a httpd/apache user, wish I could be of more help with this.

If this doesn't work, try to get back some details or something I can test so I can replicate
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

Suggested Solutions

Title # Comments Views Activity
C# MVC Insert Multiple Row into DB 2 61
Button on Table, name table1 not working 4 33
Multi-Column Repeater 3 22
JQuery DataTable Functionality 8 11
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

713 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