Solved

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

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

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 you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

789 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