Rewriting, relative paths and themes

Discussion in 'ASP .Net' started by =?Utf-8?B?R3JhaGFt?=, Feb 11, 2005.

  1. 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!!
    =?Utf-8?B?R3JhaGFt?=, Feb 11, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?R3JhaGFt?=

    Stefano Guest

    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" <> ha scritto nel messaggio
    news:...
    > 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!!
    Stefano, Feb 11, 2005
    #2
    1. Advertising

  3. 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" <> ha scritto nel messaggio
    > news:...
    > > 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!!

    >
    >
    >
    =?Utf-8?B?R3JhaGFt?=, Feb 11, 2005
    #3
  4. "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" <> ha scritto nel messaggio
    > > news:...
    > > > 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!!

    > >
    > >
    > >
    =?Utf-8?B?dg==?=, Feb 13, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Roel
    Replies:
    2
    Views:
    472
  2. Noah
    Replies:
    5
    Views:
    781
  3. Smokey Grindle

    URL Rewriting and themes

    Smokey Grindle, Oct 2, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    286
    Smokey Grindel
    Oct 3, 2006
  4. =?Utf-8?B?bXVzb3NkZXY=?=

    URL Rewriting and file paths

    =?Utf-8?B?bXVzb3NkZXY=?=, Jul 26, 2007, in forum: ASP .Net
    Replies:
    9
    Views:
    1,584
    Karina Zambrano
    Jan 13, 2011
  5. Ohad Lutzky

    Paths, gentleman, paths

    Ohad Lutzky, Nov 6, 2006, in forum: Ruby
    Replies:
    2
    Views:
    192
    David Vallner
    Nov 7, 2006
Loading...

Share This Page