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 850625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:17:38+00:00 2026-05-15T07:17:38+00:00

I have an ASP.NET MVC web application running in IIS as a subweb; let’s

  • 0

I have an ASP.NET MVC web application running in IIS as a subweb; let’s say its path is something like http://mysite.com/subweb.

I have a view which serves content obtained from a CMS. The CMS editor has entered some content containing a relative image path <img src=”/images/imga.png” />.

This works fine on the production server where the site is the root website, but not on the staging server where the site is a virtual directory under the root website

The path should be <img src=”/images/imga.png” /> on the production server

and <img src=”/subweb/images/imga.png” /> on the staging server.

Is it possible to use the <base> tag to resolve this image path?


<head>
<base href="http://mysite.com/subweb/" />
</head>

<html>
  <body>
    <img src="/images/imga.png" />
  </body>
</html>


It doesn’t seem to work. Can anyone explain why or if this is a workable approach? I don’t want to require the content editor to have knowledge of the website deployment option (which changes between UAT and production).

  • 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-05-15T07:17:38+00:00Added an answer on May 15, 2026 at 7:17 am

    Try

       <img src="images/imga.png" />
    

    to make it a relative URL. Of course it’s not that easy, the content editor must be changed. But I do believed that is the problem. URLs starting with a / are resolved from… (wonders) the domain’s top-level directory?

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

Sidebar

Related Questions

I have an ASP.NET 4.0 MVC web application running on IIS 6.0 with a
I have an ASP.NET MVC 3 Beta application running on IIS. In my web.config
I have asp.net mvc 4 web application project on my server in IIS Directory.
I have an Asp.Net MVC 2 web application deployed on IIS 7.5 on .Net
I have an ASP.NET MVC web application running from http://localhost/myappname . From jQuery, I
I have a Asp.net MVC web application, containing mostly text. I want to put
Here's what I'm trying to do. I have an ASP.NET MVC web application, where
I have developed a MVC web application with ASP.NET MVC and im just wondering
I have created blank Asp.Net-MVC 3 web application and want to write my own
I have one question; In my ASP.NET MVC web application have to do certain

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.