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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:06:21+00:00 2026-05-27T08:06:21+00:00

If I have two folders in localhost: localhost\sites\dog localhost\sites\cat How can I make all

  • 0

If I have two folders in localhost:

  • localhost\sites\dog
  • localhost\sites\cat

How can I make all relative urls in files within each folder use the respective folder as the root? If possible, is there a general way to have all folders in the sites folder automatically serve as the root for all relative urls in them?

  • 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-27T08:06:22+00:00Added an answer on May 27, 2026 at 8:06 am

    The easiest way to achieve what you are asking is by using the HTML base tag (although there are some drawbacks). This allows you to specify a default URL for all links within a site. In the following example the relative root for the document is http://www.apache.org/ so the /images/feather-small.gif would be loaded from http://www.apache.org/images/feather-small.gif.

    <html>
    <head>
    <title></title>
    <base href="http://www.apache.org/" />
    </head>
    <body>
    <img src="/images/feather-small.gif" />
    </body>
    </html>
    

    For your sites you would need each site to contain slightly different base tags like:

    <base href="http://localhost/sites/cats/" />
    <base href="http://localhost/sites/dogs/" />
    

    I would imagine if you had lots of sites this could get pretty tedious (especially if you wanted to swap the sites about). One option is to configure the base tag for each site in one place and then incorporate this using something like server side includes (mod_include). Assuming your sites are static content hosted on Apache you could use mod_include could to provide the dynamic base tag includes. Alternatively if your sites were dynamically scripting using PHP, ASP, JSP (or similar) you could acquire or generate the base tag using those technologies.

    If you created a basetag.txt containing:

    <base href="http://localhost/sites/cats/" />
    

    you could reference this in your static content, e.g. index.html might contain:

    <!--#include virtual="./basetag.txt" -->
    

    Then if you needed to move the site to say “felines” you would only need to edit the one file basetag.txt.

    I hope this helps.

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

Sidebar

Related Questions

Have two folders with approx. 150 java property files. In a shell script, how
I have two set of folders that have files with the same filenames and
I have two folders A and B ..Inside A multiple files are there and
I have two folders each which contain a lot of subfolders. Most of the
I have two folders, for arguments sake /Volumes/A and /Volumes/B. They are mounted network
I have two folders php and perl . They contain index.php and index.pl ,
in /usr/local i now have two mysql folders: mysql-5.1.34-osx10.5-x86 mysql-5.1.37-osx10.5-x86_64 is it possible to
I have wrote an application that syncs two folders together. The problem with the
I have used two GUIDs to open the folders My Computer and My Documents
I have two .ascx files in the same folder in an ASP.NET MVC project.

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.