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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T13:27:49+00:00 2026-05-10T13:27:49+00:00

Is it possible to configure xampp to serve up a file outside of the

  • 0

Is it possible to configure xampp to serve up a file outside of the htdocs directory?

For instance, say I have a file located as follows:

C:\projects\transitCalculator\trunk\TransitCalculator.php

and my xampp files are normally served out from:

C:\xampp\htdocs\

(because that’s the default configuration) Is there some way to make Apache recognize and serve up my TransitCalculator.php file without moving it under htdocs? Preferably I’d like Apache to serve up/have access to the entire contents of the projects directory, and I don’t want to move the projects directory under htdocs.

edit: edited to add Apache to the question title to make Q/A more ‘searchable’

  • 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. 2026-05-10T13:27:49+00:00Added an answer on May 10, 2026 at 1:27 pm

    Ok, per pix0r‘s, Sparks‘ and Dave‘s answers it looks like there are three ways to do this:


    Virtual Hosts

    1. Open C:\xampp\apache\conf\extra\httpd-vhosts.conf.
    2. Un-comment ~line 19 (NameVirtualHost *:80).
    3. Add your virtual host (~line 36):

      <VirtualHost *:80>     DocumentRoot C:\Projects\transitCalculator\trunk     ServerName transitcalculator.localhost     <Directory C:\Projects\transitCalculator\trunk>         Order allow,deny         Allow from all     </Directory> </VirtualHost> 
    4. Open your hosts file (C:\Windows\System32\drivers\etc\hosts).

    5. Add

      127.0.0.1 transitcalculator.localhost #transitCalculator 

      to the end of the file (before the Spybot – Search & Destroy stuff if you have that installed).

    6. Save (You might have to save it to the desktop, change the permissions on the old hosts file (right click > properties), and copy the new one into the directory over the old one (or rename the old one) if you are using Vista and have trouble).
    7. Restart Apache.

    Now you can access that directory by browsing to http://transitcalculator.localhost/.


    Make an Alias

    1. Starting ~line 200 of your http.conf file, copy everything between <Directory 'C:/xampp/htdocs'> and </Directory> (~line 232) and paste it immediately below with C:/xampp/htdocs replaced with your desired directory (in this case C:/Projects) to give your server the correct permissions for the new directory.

    2. Find the <IfModule alias_module></IfModule> section (~line 300) and add

      Alias /transitCalculator 'C:/Projects/transitCalculator/trunk' 

      (or whatever is relevant to your desires) below the Alias comment block, inside the module tags.


    Change your document root

    1. Edit ~line 176 in C:\xampp\apache\conf\httpd.conf; change DocumentRoot 'C:/xampp/htdocs' to #DocumentRoot 'C:/Projects' (or whatever you want).

    2. Edit ~line 203 to match your new location (in this case C:/Projects).


    Notes:

    • You have to use forward slashes ‘/’ instead of back slashes ‘\’.
    • Don’t include the trailing ‘/’ at the end.
    • restart your server.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 74k
  • Answers 74k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer This is relatively straightforward task. Your EAR file needs to… May 11, 2026 at 2:21 pm
  • added an answer You may want to read this TIP. In this tip,… May 11, 2026 at 2:21 pm
  • added an answer I finally have an answer for this problem a few… May 11, 2026 at 2:21 pm

Related Questions

Heres the problem. I use around three different machines for development. My partner is
Is it possible to configure nHibernate to connect to Paradox database ( *.db files)?
Is it possible to configure two separate web apps (WAR) in a J2EE application
Is it possible to configure the default file extension that Oracle's Pro*COBOL precompiler assumes

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.