Solved

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

Posted on 2006-06-16
4
205 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VPS will not allow me to send email to an email address with the same domain but on a remote server 8 159
PHP in Apache server 20 92
ports for sccm 2012 1 80
Apache Issues 9 80
In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

776 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