473,397 Members | 1,972 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,397 software developers and data experts.

Rewriting, relative paths and themes

I have a problem that I can see the reason for but cannot figure out a
solution.

I am using a simple URL rewriter to map www.me.com/1/2/3/4/product.aspx to
www.me.com/product?filter=1/2/3/4 to make my site Google-friendly. The site
dynamically adopts the correct master pages and themes according to a host
header-based query in SQL 2005 and via a custom sqlsitemapdatasource
automagically configures a breadcrumb and menus, all of which work
wonderfully.
However the theme's stylesheet is always declared in the page as a relative
reference (e.g. "Themes/me.com/stylesheet.css") which means that for the
rewritten rule the browser client will be looking for
"www.me.com/1/2/3/4/Themes/me.com/stylesheet.css". Does anybody have a way
of specifying that this be output as a url relative to root
("~/blah/blah/...") as I don't want to have to do a replace on render because
of the hit per page that would incur.

Ta!!
Nov 19 '05 #1
3 1548
Hi,

I think the only way to solve this problem is to put the reference to the
css as absolute url:
"/Themes/me.com/stylesheet.css"

When you insert a "/" as the first character, the browser always points to
the root of the site.

HTH

Bye,
Stefano

"Graham" <Gr****@discussions.microsoft.com> ha scritto nel messaggio
news:92**********************************@microsof t.com...
I have a problem that I can see the reason for but cannot figure out a
solution.

I am using a simple URL rewriter to map www.me.com/1/2/3/4/product.aspx to
www.me.com/product?filter=1/2/3/4 to make my site Google-friendly. The site dynamically adopts the correct master pages and themes according to a host
header-based query in SQL 2005 and via a custom sqlsitemapdatasource
automagically configures a breadcrumb and menus, all of which work
wonderfully.
However the theme's stylesheet is always declared in the page as a relative reference (e.g. "Themes/me.com/stylesheet.css") which means that for the
rewritten rule the browser client will be looking for
"www.me.com/1/2/3/4/Themes/me.com/stylesheet.css". Does anybody have a way of specifying that this be output as a url relative to root
("~/blah/blah/...") as I don't want to have to do a replace on render because of the hit per page that would incur.

Ta!!

Nov 19 '05 #2
Hi there

Yes that would be the solution but the stylesheet reference is inserted
directly by the Theming process & I have no opportunity to specify it as a
root reference or otherwise! Unless I'm going completely mad, that is, but
thank you for the suggestion.

Anybody got any ideas how to hook into the theme process?

Cheers again!!

"Stefano" wrote:
Hi,

I think the only way to solve this problem is to put the reference to the
css as absolute url:
"/Themes/me.com/stylesheet.css"

When you insert a "/" as the first character, the browser always points to
the root of the site.

HTH

Bye,
Stefano

"Graham" <Gr****@discussions.microsoft.com> ha scritto nel messaggio
news:92**********************************@microsof t.com...
I have a problem that I can see the reason for but cannot figure out a
solution.

I am using a simple URL rewriter to map www.me.com/1/2/3/4/product.aspx to
www.me.com/product?filter=1/2/3/4 to make my site Google-friendly. The

site
dynamically adopts the correct master pages and themes according to a host
header-based query in SQL 2005 and via a custom sqlsitemapdatasource
automagically configures a breadcrumb and menus, all of which work
wonderfully.
However the theme's stylesheet is always declared in the page as a

relative
reference (e.g. "Themes/me.com/stylesheet.css") which means that for the
rewritten rule the browser client will be looking for
"www.me.com/1/2/3/4/Themes/me.com/stylesheet.css". Does anybody have a

way
of specifying that this be output as a url relative to root
("~/blah/blah/...") as I don't want to have to do a replace on render

because
of the hit per page that would incur.

Ta!!


Nov 19 '05 #3
v


"Graham" wrote:
Hi there

Yes that would be the solution but the stylesheet reference is inserted
directly by the Theming process & I have no opportunity to specify it as a
root reference or otherwise! Unless I'm going completely mad, that is, but
thank you for the suggestion.

Anybody got any ideas how to hook into the theme process?

Cheers again!!

"Stefano" wrote:
Hi,

I think the only way to solve this problem is to put the reference to the
css as absolute url:
"/Themes/me.com/stylesheet.css"

When you insert a "/" as the first character, the browser always points to
the root of the site.

HTH

Bye,
Stefano

"Graham" <Gr****@discussions.microsoft.com> ha scritto nel messaggio
news:92**********************************@microsof t.com...
I have a problem that I can see the reason for but cannot figure out a
solution.

I am using a simple URL rewriter to map www.me.com/1/2/3/4/product.aspx to
www.me.com/product?filter=1/2/3/4 to make my site Google-friendly. The

site
dynamically adopts the correct master pages and themes according to a host
header-based query in SQL 2005 and via a custom sqlsitemapdatasource
automagically configures a breadcrumb and menus, all of which work
wonderfully.
However the theme's stylesheet is always declared in the page as a

relative
reference (e.g. "Themes/me.com/stylesheet.css") which means that for the
rewritten rule the browser client will be looking for
"www.me.com/1/2/3/4/Themes/me.com/stylesheet.css". Does anybody have a

way
of specifying that this be output as a url relative to root
("~/blah/blah/...") as I don't want to have to do a replace on render

because
of the hit per page that would incur.

Ta!!


Nov 19 '05 #4

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

Similar topics

7
by: Doug | last post by:
If I were to write an include with a relative path like include("../conf/config.php"); What is the use? As far as I understand it, the path is relative to the first script that is called by...
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...
15
by: Nick K. | last post by:
I recently began maintenance work on a production web server that is located in the root directory of a web server. I moved this into a sub web on my local web server in order to do work on it. I...
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...
1
by: Smokey Grindle | last post by:
How have you guys handled the postback / themes problem with url rewriting in ASP.NET 2.0?
8
by: JJ | last post by:
I'm confused about paths. I have a functionn that uses the mappath method, which I think requires a virtual path (is that the same as a relative path?). But this doesn't always work as 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...
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...
2
by: BD | last post by:
Hi there. Using 8.2 on Windows. I have a situation where I have a db backup, which I want to deploy to a group of developer workstations. The target directory for the database files will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...

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.