Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7902937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:38:08+00:00 2026-06-03T09:38:08+00:00

My goal is to share images, css, js, etc. across multiple websites that are

  • 0

My goal is to share images, css, js, etc. across multiple websites that are all hosted under the same parent virtual directory in IIS. Of course, I could hard code the images paths, but I’d hoped .NET had a method that could intelligently resolve URLs using the IIS configuration.

Here is my file/virtual directory structure:

Parent Site (Virtual Directory)
  default.aspx
  mypage.aspx
  otherpage.aspx
  images
    - logo.jpg
  css
    - site.css
  Subsite1 (Virtual Directory)
    - default.aspx
    - products.aspx
  Subsite2 (Virtual Directory)
    - default.aspx
    - products.aspx
    - miscellaneous.aspx

Parent Site, Subsite1, and Subsite2 are all virtual directories set up for http://parentsite.com, http://subsite1.com, and http://subsite2.com, respectively. I want to share images, js, css, etc. across these sites.

Is there a method in .NET that will resolve ~/images/logo.jpg as http://parentsite.com/images/logo.jpg when called from one of the subsites (e.g., http://subsite.com/default.aspx)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T09:38:09+00:00Added an answer on June 3, 2026 at 9:38 am

    In IIS6 and even IIS7 you can use a new virtual directory, call it “assets”, in all of the children sites.

    Updated site layout:

    Parent Site (Virtual Directory)
         default.aspx
         mypage.aspx
         otherpage.aspx
         assets
              -images
                   - logo.jpg
              -css
                   - site.css    
    
    Subsite1 (Virtual Directory)
         - default.aspx
         - products.aspx
         assets (Virtual Directory to parent assets)
    
    Subsite2 (Virtual Directory)
         - default.aspx
         - products.aspx
         - miscellaneous.aspx 
         assets (Virtual Directory to parent assets)
    

    With this structure you can share the same “assets” folder with all sites and still access it as “~/assets”. This allows you to use the assets with any of the domains that IIS is answering for.

    http://parentsite.com/assets

    http://childsite.com/assets

    A CDN is a good option but often times you would create seperate DNS enteries for each site like http://cdn.parentsite.com and http://cdn.childsite.com and then create some function to reference the files as http://cdn.(currentdomain).

    In my opinion, using an absolute or relative path to the shared assets folder will make life easier for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to plan a series of websites that all share many of the
The goal: pull from members walls - if two friends share the same churchMember
Is Kernel.Get() threadsafe? My goal is share an instance of my kernel among all
My goal is to send/share data between multiple programs . These are the options
i have multisite setup where imagecache module resides under sites/all. My goal is for
Goal is to make a dialog that appears on menu_key pressed, but it keeps
Goal: Produce an Excel document with information from 3 associated models that is similar
Hey all, i've been working on this small project in XNA the goal is
I've written an iPhone app that uses CocoaHttpServer to share the Documents/ folder of
My goal is to be able to share configration settings amongst apps. For example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.