Solved

EASY QUESTION -- how do i get localhost to see other directories not under the apache root

Posted on 2006-06-16
4
203 Views
Last Modified: 2011-09-20
OK this is probably a very easy question - I have apache running in c:\program files\Apache Group\Apache (the default setup)

it sees the directory underneath, like all the files in htdocs and I can enter http://localhost/somefile.php

How can enter the url to map it to something like c:\addresses\addresses.php - how do i enter the url or is there a place where I can map it to other directories?
0
Comment
Question by:PurpleSlade
  • 2
  • 2
4 Comments
 
LVL 37

Expert Comment

by:Harisha M G
ID: 16924440
Hi, open httpd.conf

add a line:

Alias /somefile.php "c:/addresses/addresses.php"  

---
Harish
0
 
LVL 2

Author Comment

by:PurpleSlade
ID: 16924523
OK I see the following in my config file:

My question is - do I need to fill out the directory xml and also would I want to make it a scriptalias.  Also, it doesn't seem very efficient to do it on a file by file basis, so I would probably want to do the addresses directory.

#
# Aliases: Add here as many aliases as you need (with no limit). The format is
# Alias fakename realname
#
<IfModule mod_alias.c>

    #
    # Note that if you include a trailing / on fakename then the server will
    # require it to be present in the URL.  So "/icons" isn't aliased in this
    # example, only "/icons/".  If the fakename is slash-terminated, then the
    # realname must also be slash terminated, and if the fakename omits the
    # trailing slash, the realname must also omit it.
    #
    Alias /icons/ "C:/Program Files/Apache Group/Apache/icons/"

    <Directory "C:/Program Files/Apache Group/Apache/icons">
        Options Indexes MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>

    # This Alias will project the on-line documentation tree under /manual/
    # even if you change the DocumentRoot. Comment it if you don't want to
    # provide access to the on-line documentation.
    #
    Alias /manual/ "C:/Program Files/Apache Group/Apache/htdocs/manual/"

    <Directory "C:/Program Files/Apache Group/Apache/htdocs/manual">
        Options Indexes FollowSymlinks MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>

    #
    # ScriptAlias: This controls which directories contain server scripts.
    # ScriptAliases are essentially the same as Aliases, except that
    # documents in the realname directory are treated as applications and
    # run by the server when requested rather than as documents sent to the client.
    # The same rules about trailing "/" apply to ScriptAlias directives as to
    # Alias.
    #
    ScriptAlias /cgi-bin/ "C:/Program Files/Apache Group/Apache/cgi-bin/"

    #
    # "C:/Program Files/Apache Group/Apache/cgi-bin" should be changed to whatever your ScriptAliased
    # CGI directory exists, if you have that configured.
    #
    <Directory "C:/Program Files/Apache Group/Apache/cgi-bin">
        AllowOverride None
        Options None
        Order allow,deny
        Allow from all
    </Directory>

</IfModule>
# End of aliases.
0
 
LVL 37

Accepted Solution

by:
Harisha M G earned 500 total points
ID: 16924533
Alias /scripts/ "C:/scripts/"

where /scripts/ refers to the directory you'll refer... as in http://localhost/scripts/
0
 
LVL 2

Author Comment

by:PurpleSlade
ID: 16924627
OK, that does work!  Thanks!
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now