ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

propagate a style.css and index.php to work in all subdirectories in a webfolder

<< < (2/2)

Ath:
About Apache configuration:
AFAICS, you should start reading (and some experimenting) on this Apache wiki page about DirectoryListings and how to configure that. I have no LAMP/WAMP installation available, so am unable to provide more detailed pointers, sorry.

About the .style.css file needing to be copied into each directory:
This is caused by this line in .index.php:

--- ---<link rel="stylesheet" href="./.style.css">
It points to that file in the current directory ( ./ in front of the filename is a relative location).

By placing the .style.css file into a specific directory like directorystyle in the root of your website, and changing the above line into:

--- ---<link rel="stylesheet" href="/directorystyle/.style.css">
you are addressing the file at it's absolute location, and has to be stored only once at the server.
Renaming the file and moving it to the default styles directory is also an option, ofcourse.

The period as the first character of the filename makes the file invisible on *nix OS's, and it can be omitted if the file is moved out of the directories that are visible to the enduser. The name used in .index.php has to be adjusted accordingly, as is to be expected ;)
The same goes for the .index.php file, after you have moved it out of the visible directories using the first pointer in this post.

questorfla:
Thanks.  Your Instructions might get me there.  Eventually.  I had already tried changing the index.php for something similar and even with your exact wording it only works if i include a copy of both index.php AND a copy of styles.css in every subdirectory of every folders in documents directory.   
I am sure you are correct and it does have something to do with the relational path but for some reason on this setup I can't seem to get anything to work other than as it was
 
Many Thanks for your help.   At least I know now that I was looking in the correct direction.  One of the other members also sent me to a file called directory lister and for some reason THAT one Does work properly and even has the added pointers for forward and back.  But:  It is hard to read with fonts too small and colors light and it doesn't have an easy to work with styles.css like this one to make changes.   I wish i could merge the best of both. 

Maybe I need to try to merge the path statements from the new index.php such that it is stated in the first instance of index.php  on the website?  Rather hqan the following one it finds in the documents folder?    Or maybe it would be easier to change the Look of the directory lister snippet instead? https://github.com/topics/directory-lister Always some kind of decision to make.  :(

 

Navigation

[0] Message Index

[*] Previous page

Go to full version