Forum Moderators: phranque

Message Too Old, No Replies

Stylizing the index, modifications to fancyindexing?

Stylizing the index, modifications to fancyindexing?

         

drooh

7:27 am on Apr 16, 2007 (gmt 0)

10+ Year Member



I have just set up my server running on apache 2.2 with php and the extras. I previously was using xampp.

I have noticed that the root index looks a little different than what I am used to. I was able to add in the fancyindexing options.

My question is what else can be changed in regards to the appearance of the index? For instance I would like to change the default font..?

Any help or examples would be much appreciated, thank you!

coopster

12:36 pm on Apr 16, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Have a read through mod_autoindex paying particular attention to HeaderName [httpd.apache.org].

drooh

6:19 am on Apr 17, 2007 (gmt 0)

10+ Year Member



i realize that I can change the style of a particular index using "header.html" and adding in some general css,

but is there a way to change style globably for all the indexes of apache?

coopster

4:41 pm on Apr 19, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



If you wanted to change the default across the board you would setup the
HeaderName
in your base configuration (usually
httpd.conf
, or in Apache 2.2 it has now been moved to
conf/extra/httpd-autoindex.conf
). Base install looks like this:

HeaderName HEADER.html

The Apache documentation noted earlier tells us that the filename specified is done so as a URI path relative to the one used to access the directory being indexed. If the filename begins with a slash, it will be taken to be relative to the

DocumentRoot
.

So, using the configuration above which is the default Apache configuration directive, we can assume that Apache is going to look for

HEADER.html
in the same directory as the one being indexed. You would have to copy that same
HEADER.html
to each and every directory you want to have that configuration. I imagine this is your dilemma and the problem for which you seek resolution.

Off the top of my head I would think that an Alias [httpd.apache.org] would work, but be careful that you don't use a path/filename combination that you might ever use in your hosted sites!

HeaderName /nonexistentdirectory/HEADER.html 
Alias /nonexistentdirectory/HEADER.html /path/to/real/HEADER.html

jdMorgan

6:30 pm on Apr 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If the filename begins with a slash, it will be taken to be relative to the DocumentRoot.

This allows you to use one header file for all directories, and it can be located anywhere below DocumentRoot. For example, to use the header file in /headers/global/header.html for all directories:


HeaderName /headers/global/header.html

Jim

drooh

9:43 am on Apr 20, 2007 (gmt 0)

10+ Year Member



jp, thanks that seems to work well. i can even adjust the table width and other attributes.

now my question is how to you prevent apache from truncating your folder & file names. for instance i have some longer folder names that are getting cut off looking like this

gathering_texas_vide..>

drooh

10:01 am on Apr 20, 2007 (gmt 0)

10+ Year Member



IndexOptions FancyIndexing VersionSort NameWidth=*

add that to your httpd.conf

coopster

7:13 pm on Apr 20, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



This allows you to use one header file for all directories

... but only in the same <VirtualHost> container. I was under the impression that the same exact header was desired across all sites hosted on the server. Using an alias in the conf will allow you to do so if desired.