I seem to have a slight problem:

I would like to add a directory that is web-browsable and that is not below my documentroot.
I guess I have to make a link of some kind somewhere or have to edit httpd.conf but have no clue whatsoever on how to do this correctly.

my documentroot= c:\program files\abria soft\apache\htdocs

folder i would like to make browsable=
c:\temp\php\images

I have to use a directory without spacings in name,else copy/rename filefunctions seem to barf.

I would be very thankfull if one of you coders could help me out! BTW apache&php&Mysql Rule the face of this planet!

    Hi Yoma,

    Open up httpd.conf in Notepad and locate the follwing sections of code.

    FIRSTLY edit the line -

    #

    DocumentRoot: The directory out of which you will serve your

    documents. By default, all requests are taken from this directory, but

    symbolic links and aliases may be used to point to other locations.

    #
    DocumentRoot "C:/Program Files/Apache Group/Apache/htdocs/ <------------------- RIGHT HERE and set this to whatever directory you require.

    SECONDLY do the same again for a couple of lines below that -

    Note that from this point forward you must specifically allow

    particular features to be enabled - so if something's not working as

    you might expect, make sure that you have specifically enabled it

    below.

    #

    #

    This should be changed to whatever you set DocumentRoot to.

    #
    <Directory "C:/Program Files/Apache Group/Apache/htdocs/ <--------------- RIGHT HERE
    .

    The is also a line that you may also want to edit which will allow u to specify what file you wish to be default when you access localhost.

    #
    <IfModule mod_dir.c>
    DirectoryIndex index.php <------ RIGHT HERE
    </IfModule>

    Hope this helps.

    -Abi

      i suggest just makiing (or just cut/paste) the \images folder in the htdocs folder, so you'd get this effect..

      http://localhost/images

      which i'm pretty sure is what you want.

        Actually, if you look at the Apache config file then you have answer right there before your very eyes.

        You need to make an alias, just look how Apache handles /icons directory and add your own according to example:

        --- 8< -----------------------

        <IfModule mod_alias.c>

        Apache default alias for icons

        Alias /icons/ "C:/apache/icons/"
        
        <Directory "C:/apache/icons">
            Options Indexes MultiViews
            AllowOverride None
            Order allow,deny
            Allow from all
        </Directory>

        Your alias below where "/phpimages" is the

        name by which it is later accessed counting

        from docroot eg "http://myhost/phpimages"

        Alias /phpimages/ "c:/temp/php/images/"
        
        <Directory "c:/temp/php/images/">
            Options Indexes MultiViews
            AllowOverride None
            Order allow,deny
            Allow from all
        </Directory>

        </IfModule>

        --- >8 -----------------------

        Just don't forget to turn on/off options you might need or not need (like turning off Indexes).

          Thanks for helping me out guys!

            Write a Reply...