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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:56:08+00:00 2026-06-13T07:56:08+00:00

Im using Windows 7, and there I installed apache server in c:\wamp\apache\ , PHP

  • 0

Im using Windows 7, and there I installed apache server in c:\wamp\apache\, PHP is located in c:\wamp\php\, and loaded as module.

So lets say I’m building test project and I only have index.php in that project.
Folder of that project will be located in c:\wamp\apache\htdocs\test\index.php and I can access that through my browser: localhost\test

This all works nice, but I have problem when I include images, css and js files.
lets say I want to include css style, i must use this:

<link rel="stylesheet" href="/test/images/image.jpg" />

and I would like to use this for a href:

<link rel="stylesheet" href="/images/image.jpg" />

So that / is root, and from there I can search for files inside my project folder.

What should I do? Should I create virtual server for every project, or there is a way that every folder in my htdocs folder acts as it would on live server, where / would translate to document root?

How should I setup Apache server so that every folder in my htdocs folder acts as server for itself?
When I use XAMPP it works like that.

Thanks!

  • 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-13T07:56:09+00:00Added an answer on June 13, 2026 at 7:56 am

    If you want to avoid these kind of headaches, you should have a virtualhost for every project.

    You can just put in your httpd.conf (with wamp: left click on wamp > apache > httpd.conf)

    # To access your old projects under C:\wamp\www
    NameVirtualHost localhost:80
    <VirtualHost localhost:80>
    ServerName localhost
    ServerAlias localhost
    DocumentRoot C:\wamp\www
    <Directory "C:\wamp\www">
        Options Indexes FollowSymLinks
        AllowOverride All
        Order Deny,Allow
        Deny from all
        Allow from 127.0.0.1
    </Directory>
    </VirtualHost>
    
    # each virtualhost should look like that
    NameVirtualHost localhost.yourproject.com:80
    <VirtualHost localhost.yourproject.com:80>
    ServerName localhost.yourproject.com
    ServerAlias localhost.yourproject.com
    DocumentRoot C:\path\to\yourproject
    <Directory "C:\path\to\yourproject">
        Options Indexes FollowSymLinks
        AllowOverride All
        Order Deny,Allow
        Deny from all
        Allow from 127.0.0.1
    </Directory>
    </VirtualHost>
    

    Don’t forget to restard wamp, and include in your hostfile (C:\Windows\System32\drivers\etc\hosts):

    127.0.0.1       localhost.yourproject.com
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using WAMP on windows, which installs PHP, Apache and MySQL. I'm now working
I have an apache server installed on my portable windows 7 machine using xampp
I'm trying to setup an Apache/PHP/Postgresql server locally on my machine. I'm using Windows
I want to execute a .exe file on my Apache server using a php
I'm trying to install the mod_xsendfile Apache Module on Windows (7) x64 (using Apache
Is there a better method (using Windows) for getting a moderate amount of data
Is there a way (on windows using Delphi 2010) to get the number of
Is there a way to manipulate the mouse position without using System.Windows.Forms.Cursor? Something like
In C#/.NET (on Windows) is there a way to read a growing file using
Is there possibility to compile windows service using only mingw c++ compiler and library?

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.