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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:11:26+00:00 2026-06-15T13:11:26+00:00

Im working with a lots of project locally. I have set my apache root

  • 0

Im working with a lots of project locally. I have set my apache root to refer to my folder containing all of my projects, so localhost simply get me there.

Inside subfolders of localhost (wich is root) i would like to add a rewrite rule so / refers to the PROJECT root, not localhost.

Example of my structure:

localhost/a-very-nice-projekt/

Inside the project I want to file link to root like this src="/img/picture.jpg". It would make it easy to move around folders without the need to change links. It also makes it possible to use php include of my navbar and header as links always refers to project root.

Tried a lot of googling and code but I think I’m a little bit wrong…

  • 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-15T13:11:27+00:00Added an answer on June 15, 2026 at 1:11 pm

    I don’t believe you can really do what you are trying to do, at least through .htaccess. In your case localhost is the domain, and the leading slash in the links tells the browser to grab the resource from that path relative to the domain. Different rules in different folders can’t really affect this.

    Your best bet is probably to create various virtual hosts on different ports, that would act as separate sites. Create one vhost for each project in your httpd.conf file.

    Listen 8081
    NameVirtualHost *:8081
    <VirtualHost *:8081>
        DocumentRoot "C:\Path\to\project"
        <Directory "C:\Path\to\project">
            DirectoryIndex index.php
            AllowOverride None
            Order allow,deny
            Allow from all
        </Directory>
    </VirtualHost>
    

    Then, this project would be accessed in your browser as http://localhost:8081/. All the paths will work as expected and you should be good to go.

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

Sidebar

Related Questions

I am working in a fairly big project. We have lots of projects and
I have lots of forms on a project I'm working on. All the forms
Working on a project where they have lots of enums and lots of duplicated
For a project I'm working on I will have multiple servers and lots of
I'm working on a project that will have a single table holding lots and
I'm working on a (c++, opengl) project where I need to have lots of
So I am working on a project where we have lots of Apps which
I am working on a project which will have lots and lots of Layout
On the project I'm currently working on, we have lots of folders in the
The project that I am working on (Node.js) implies lots of operations with 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.