logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Directory Browsing Without Showing Path
Author
moonbug



Joined: 05 Oct 2006
Posts: 2

PostPosted: Fri 06 Oct '06 0:04    Post subject: Directory Browsing Without Showing Path Reply with quote

I allowed directory browsing but it always shows the directory path. How can I prevent it from showing the directory path (Index of ...)? For example, the web page displays:

Index of folder1/folder2 <-I want this gone
* parent directory
* filename 1
* filename 2
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7364
Location: Germany, Next to Hamburg

PostPosted: Fri 06 Oct '06 10:34    Post subject: Reply with quote

You have to write a script that displayes that. Or chamge the sour from apache and compile it.
Back to top
Jorge



Joined: 12 Mar 2006
Posts: 376
Location: Belgium

PostPosted: Fri 06 Oct '06 11:00    Post subject: Reply with quote

by including an empty HEADER file Smile

You can set it to a full path like /HEADER in the config and it should use the same file for all indexes

But why remove it?

The user can see that in the url aswel!

/private just meast it the folder private in the root of the server that is also reflected in the url http://domain.com/private?
Back to top
moonbug



Joined: 05 Oct 2006
Posts: 2

PostPosted: Sat 07 Oct '06 0:04    Post subject: Reply with quote

Is there a way to do this without recompiling Apache?
Reason I'm doing it is for the looks only. Sometimes the path is long about 5 sub directories.

I have seen some Apache where the INDEX line is not displayed at all, only displays the parent directory.
Back to top
tdonovan
Moderator


Joined: 17 Dec 2005
Posts: 611
Location: Milford, MA, USA

PostPosted: Sat 07 Oct '06 16:36    Post subject: Reply with quote

Jorge's suggestion is correct, but maybe you misunderstood what he meant.
There is no need to re-compile Apache.

    Create an empty text file named HEADER.html in your web root directory.

    Edit the file {ApacheDirectory}\conf\extra\httpd-autoindex.conf

      near the bottom of this file is the line:
      HeaderName HEADER.html

      change it to:
      HeaderName /HEADER.html

    Restart Apache

All your directory listings will no longer show the directory path at the top of the page.

-tom-
Back to top


Reply to topic   Topic: Directory Browsing Without Showing Path View previous topic :: View next topic
Post new topic   Forum Index -> Apache