473,473 Members | 1,534 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Url Rewrite and relative paths

I'm using a url rewriting mechanism to make my site's urls more
search-engine/user-friendly, so we have http://www.mysite.com/links/1023.apx
which is actually internally mapped to
http://www.mysite.com/links.aspx?link=1023. This works fine and makes the
site look a lot cleaner.

The problem I'm having is with controls on the target page. I render all the
urls as root relative so that I'm independent of whether I'm a root web or
an application, so we have ~/images/img1.jpg for images and and
~/links/4096.aspx as a child link of 1023. The problem is that the ASP.NET
controls convert my relative paths to images/img1.jpg and links/4096.aspx,
when evaluated these become http://www.mysite.com/links/images/img1.jpg and
http://www.mysite.com/links/links/4096.aspx which of course don't exist.

Now interestingly, if I call ResolveUrl in the page on say ~/images/img1.jpg
I correctly get /images/img1.jpg, there's basically a different behaviour
between ResolveUrl and Control.ResolveUrl. I have a workaround, which is to
make everything an absolute path, but it's not very satisfactory since it
makes demoing stuff to clients a pain - you have to have a root web
available rather than just creating an application directory somewhere.

I'd call this a bug, since there should only be one implementation of
something like ResolveUrl.

Anyone else found this and have a better workaround?

Paul
Nov 19 '05 #1
0 1289

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

Similar topics

7
by: mark | last post by:
I am designing a website at the moment and looking at the difference between relative and absolute url links which is driving me crazy! I would like to use relative paths, but it is proving very...
5
by: jason | last post by:
Can anyone help me find a solution to quickly working out relative paths to a folder in the root of my server... Although it easy when you go - say - two levels down: .../includes it...
3
by: epigram | last post by:
I've got a javascript menu that uses an external .js file. In the .js file, there is a function that gets called by each of my .html pages to build up the menu for the page. The way I want to...
0
by: Jason Lawrence | last post by:
I have an attributed ATL project (call it B) that I am building with Microsoft Visual C++ .NET (55537-640-3684941- 18356). In the project I include the COM generated file A.h (from another ATL...
2
by: Joe | last post by:
Hi, can someone tell me how to set up relativ paths in VS2003 C++ ? I have some source with a tree directory structure that segments include files in various directories: #include...
9
by: Paul Hatcher | last post by:
Sorry to post this again - I didn't use my MSDN alias previously... I'm using a url rewriting mechanism to make my site's urls more search-engine/user-friendly, so we have...
11
by: MBS | last post by:
I am playing around with some PHP code. I want to put in an include() function so I can include existing HTML code and output it to the browser. Lo and behold PHP does not support relative paths...
9
by: Garann Means | last post by:
I have a subfolder under wwwroot set up as a virtual directory with its own application name in IIS. I pulled it down from Visual Source Safe and, on the machine where it's normally hosted, it...
15
by: Lars Eighner | last post by:
Aside from the deaths of a few extra electrons to spell out the whole root relative path, is there any down side? It seems to me that theoretically it shouldn't make any difference, and it would...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.