Hi

I wish to Rewrite Url

www.mysite.com/demo.aspx/1

instead of www.mysite.com/demo.aspx?id=1

i tried a lot with the below

http://www.qwerksoft.com/products/iisrewrite/download.asp

yet i got clear way

can anybody guide me or give me a new idea to do this stuff
( I wish to Rewrite Url

www.mysite.com/demo.aspx/1

instead of www.mysite.com/demo.aspx?id=1 )
by
Ram

Recommended Answers

All 5 Replies

i dont understand why you are intrested to do so, yet
www.mysite.com/demo.aspx?id=1

is quite safe method

can you explain your problem in detail may be i can help you .

i just don't want to show special characters like ? & % in url (or address bar)

when we use query string we should use this special characters

how can i eliminate this characters by rewritting url or any other way

I'd suggest implementing a 3rd party component. We use http://urlrewriter.net/ quite a bit and I've been very impressed with it. If you decide to go this route and end up having any issues with the setup, let us know.

It's not difficult in asp.net to use the ASP.NET built in methods to do url rewriting.

Also, if you wish to stray away from this method, just add a check at the beginning of each page.

Dim idSplit = request.serverVariables("SCRIPT_NAME").split("/")
Dim id = idSplit(idSplit.length - 1)
Dim page = idSplit(idSplit.length - 2)

If page = "demo.aspx" And Not id Is Nothing Then
    'there's a querystring.
End If

This is not a very effective way, but if it is small and minimal people are using it, it can be an easy solution.

commented: Nice to see you back bud! +3
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.