473,396 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Rewriting a URL that does not point to a file

DC
Hi,

I need something that rewrites a URL like

myserver.com/parm1/val1/parm2/val2

to

myserver.com/default.aspx?parm1=val1&parm2=val2

Tha typical Module seems to be capable of rewriting paths that point to
a file only. TIA for any ideas.

Regards

DC

Dec 12 '05 #1
3 1179
This is a valid URL path myserver.com/parm1/val1/parm2/val2. Its not
parameters on the URL line. So how would IIS know to pass the address
request to the ISAPI that handles asp.net reuqests so that you could convert
the path to: myserver.com/default.aspx?parm1=val1&parm2=val2

You would probably need to make the web server root the only application on
the server and any request for any resource mapped via IIS to asp.net, then
that will allow you to intercept and disseminate any URL request to the web
application myserver.com. You could map *.* to an ihttpmodule that looked
at the path, determined if it had an extension and then reworked the new
destination path.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"DC" <dc@upsize.de> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi,

I need something that rewrites a URL like

myserver.com/parm1/val1/parm2/val2

to

myserver.com/default.aspx?parm1=val1&parm2=val2

Tha typical Module seems to be capable of rewriting paths that point to
a file only. TIA for any ideas.

Regards

DC

Dec 12 '05 #2
DC
Thanks John. I am currently trying to archive my aim by customizing a
404 page. Since the request to

myserver.com/parm1/val1/parm2/val2

will end up as a 404 page, I can examine the Request.RawUrl on my
custom notfound.aspx and redirect to

myserver.com/default.aspx?parm1=val1&parm2=val2

from there. Any opinions about this approach?

Regards
DC

Dec 12 '05 #3
If it works for you and can scale then use it. Its probably easier than
writing an iHTTPModule, although doing a redirect incurs a second trip to
client and back to the server again. Server transfer would be better, and
the URL then would not be visible (if thats a good thing).

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"DC" <dc@upsize.de> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Thanks John. I am currently trying to archive my aim by customizing a
404 page. Since the request to

myserver.com/parm1/val1/parm2/val2

will end up as a 404 page, I can examine the Request.RawUrl on my
custom notfound.aspx and redirect to

myserver.com/default.aspx?parm1=val1&parm2=val2

from there. Any opinions about this approach?

Regards
DC

Dec 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Jon Maz | last post by:
Hi All, I am experimenting with URL Rewriting using the techniques outlined by Scott Mitchell in his article "URL Rewriting in ASP.NET"...
2
by: Jon Maz | last post by:
Hi All, I've been looking into options for URL Rewriting in .net, and to be honest, I haven't seen anything that's easier than the old Classic Asp solution with an ISAPI filter redirecting to an...
3
by: Michael Appelmans | last post by:
I'm trying to use a rule based URL rewrite application which uses HttpApplication.RewritePath. I keep getting "rsource not found" error in application when running on shared web host although the...
0
by: Lee | last post by:
Hi all ;) Preamble -------- I'm using URL rewriting to enforce a frames policy (yeah, I know frames are 'bad' :) - i.e. if a request comes in for a page which should be nested within a...
3
by: Smokey Grindel | last post by:
I am using ASP.NET 2.0 and know about the static list in the web.config for URL rewriting, but my list is dynamic and I am running into some problems... 1) How do you get URL rewriting to work in...
3
by: Greg Collins [Microsoft MVP] | last post by:
I have done a bit of research of Url Rewriting, but as yet have been unsuccessful at getting it to work well, and there are issues around what file types are supported and how much code you want to...
1
by: J. J. Ramsey | last post by:
In Perl, there is a module called "Tie::File". What it does is tie a list to each line of a file. Change the list, and the file is automatically changed, and on top of this, only the bits of the...
8
by: =?Utf-8?B?bXVzb3NkZXY=?= | last post by:
Hi guys I'm having trouble with URL rewriting using HttpApplication.Context.RewritePath in a web application I've created. Everything works, but the links (css, images) in the pages break when...
3
by: Toni | last post by:
Does anyone have a recommended method of rewriting URLs with classic ASP? For example, if the browser shows the Friendly URL www.mydomain.com/blue_widget my app will show the following Content...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.