md0333
asked on
Need to rewrite a URL using Url Rewrite in IIS7
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!
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!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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?I D=3880
So it looks like everything we are trying to do the URL rewrite on is just being omitted...
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?I
So it looks like everything we are trying to do the URL rewrite on is just being omitted...
from what you said i think you need
ServerName/WebForm1.aspx/i d/3380
should translate into
ServerName/WebForm1.aspx?i d=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
ServerName/WebForm1.aspx/i
should translate into
ServerName/WebForm1.aspx?i
is that not correct?
rule should be:
^WebForm1/([_0-9a-z-]+)/([
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
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/