473,326 Members | 2,136 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,326 software developers and data experts.

URL rewriting problem

KMA
My site has dynamicaly generated pages. Most of the URLs are false, and I
used to trap them in a generic 404 page, which stripped off a unique part of
the URL, built the page then sent that back to the client. But then the
address bar always showed the 404 plus the query string which contains the
originally requested URL. Apart form that all was well.

So to circumvent this I used URL rewriting in Global.asax. Same idea, just
look for incoming URL that doesn't correlate to physical page then
dynamically generate page and return it.

The strange this is this:
With the old system the page displayed perfectly.

With the new way the pictures don't display, and the links are broken. When
I hover over a link I see that the link includes an extra sub dir. For
example, in the old working way I get (for the "Home" link) /Default.aspx,
and for the new not working way I get /Articles/Default.aspx. The pseudo
page lies in the Articles section.

I've run the app through in both working and non-working ways, and saved the
source from each output. The source is identical. And there is no mention of
"Articles" in any link or image URL. So my question is this: Does the client
software somehow store a "base directory" and prepend this to all relative
URLS? Does using URL rewriting somehow influence this?

I'm not sure my explanantion is very clear, but hopefully someone knows what
I mean.
Mar 17 '06 #1
2 1273
Try this:
http://www.ftponline.com/vsm/2002_02...a/default.aspx

It shows how to set up a handler to intercept the call and send the person
to the correct content.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
"KMA" wrote:
My site has dynamicaly generated pages. Most of the URLs are false, and I
used to trap them in a generic 404 page, which stripped off a unique part of
the URL, built the page then sent that back to the client. But then the
address bar always showed the 404 plus the query string which contains the
originally requested URL. Apart form that all was well.

So to circumvent this I used URL rewriting in Global.asax. Same idea, just
look for incoming URL that doesn't correlate to physical page then
dynamically generate page and return it.

The strange this is this:
With the old system the page displayed perfectly.

With the new way the pictures don't display, and the links are broken. When
I hover over a link I see that the link includes an extra sub dir. For
example, in the old working way I get (for the "Home" link) /Default.aspx,
and for the new not working way I get /Articles/Default.aspx. The pseudo
page lies in the Articles section.

I've run the app through in both working and non-working ways, and saved the
source from each output. The source is identical. And there is no mention of
"Articles" in any link or image URL. So my question is this: Does the client
software somehow store a "base directory" and prepend this to all relative
URLS? Does using URL rewriting somehow influence this?

I'm not sure my explanantion is very clear, but hopefully someone knows what
I mean.

Mar 17 '06 #2

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"...
3
by: Jamie Jackson | last post by:
I'm rewriting all links' onclick events, but I'm having a problem. The onclick event that I'm inserting works correctly in Opera, but not in FF or IE. I'm retroactively adding the statement...
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: Netveloper | last post by:
Hi, I'm playing around with url rewriting and I have come across a problem which I can't seem to get past. The general ide is to have a IHttpHandlerFactory class which checks the incoming...
3
by: Stephane | last post by:
Hi, I have a problem and I haven't found a good solution yet... I'm using Url rewriting for my message board so it's more readable to have something like mysite.com/1040/message.aspx instead...
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...
0
by: psycho | last post by:
i have added url rewriting to my site. i am filling custom objects in context.items collection and then rewriting path the problem is that the page is url rewriting code is being hit two times...
2
by: Seth Williams | last post by:
The first scenario is that I want to create one website for a particular industry - let's say for Farm Machinery so I have a shared hosting site called myFarmMachinery.com But I want to sell...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.