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

  • Home
  • SEARCH
  • 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 6859679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:18:50+00:00 2026-05-27T02:18:50+00:00

I typically refer to any assets on my site using absolute path so that

  • 0

I typically refer to any assets on my site using absolute path so that I don’t have to worry about the location of the assets relative to current file.

<!-- Using a absolute path. -->
<img src="/images/flag.png" />
<!-- Using a relative path. -->
<img src="../../../images/flag.png" />

However, this time I need to host the site at a non-root location e.g. http://my-server.com/holiday/.

How would I go about this? I am looking for a solution that doesn’t require me to change the path in my files. How do I configure the server (Apache) to treat http://my-server.com/holiday/ as a “root”?

Clarification:
I still need http://my-server.com/ to behave “normally”. That is, it should still point to http://my-server.com/index.html i.e. doesn’t get redirected to http://my-server.com/holiday/.

  • 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-27T02:18:50+00:00Added an answer on May 27, 2026 at 2:18 am

    I hate to say this but none of the above provides the solution. The answers by @Zoltan and @stslavik were close but, unfortunately, didn’t work when deployed; I wished one of them worked, though.

    As a result, I resorted to using a combination of named constants and include files in PHP. More details: File Structure for a PHP Project. Note that it doesn’t have to be PHP; you can use other languages that provide similar features. +1 for @margusholland whose answer led me to experiment with this solution.

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

Sidebar

Related Questions

Typically I use E_ALL to see anything that PHP might say about my code
Typically I create a plugin when I have a module that I know I'm
Typically languages have keywords that you are unable to use directly with the exact
I've been using jQuery to build an ajax-heavy site. I typically use jQuery selectors
I have a question about formatting the Rupee currency (Indian Rupee - INR). Typically
Typically, for styles that have to be applied dynamically to HTML objects with JS,
In JavaScript, the this operator can refer to different things under different scenarios. Typically
Typically when writing new code you discover that you are missing a #include because
I have a C# Windows service that listens to a HTTP port and fires
It occurred to me today that although I've adopted and don't infrequently use the

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.