CSS styling for htaccess?

design

#1

Hi,

Apologies if this is answered elsewhere, not sure how to search it

I set up an htaccess space to allow users to have read only access to files I upload for them. Unfortunately, there’s no styling for their htaccess space and I’d like to brand it with their logo and change the font. Pretty basic stuff.

My questions are these:

  1. Do I have to make a unique one for each directory?
  2. Where would I save the stylesheet(s)?
  3. How do I attach it/them?

Any info greatly appreciated, thanks

d


#2
  1. No, a single one would suffice.

  2. Anywhere that’s accessible online. It doesn’t even have to be on the same domain (but it probably should be, if only to keep things from getting too complicated).

  3. You’d have to reference them in the of any HTML document that you wanted to use that stylesheet, e.g:


#3

Hm. That’s the thing tho - it’s just a list of files in a “folder” - wish I could attach a screenshot. So, I’m not authoring a document listing the files, and I don’t really get where that invisible document lives, and how it can be edited.

Here’s the source code - but where is it? How can I edit it???

Index of /rethink

Index of /rethink

      Name                    Last modified      Size  Description
Parent Directory - Bavarian Men's Choir..> 23-Aug-2012 16:02 1.1M

#4

What you’re using is Apache’s mod_autoindex, which generates simple directory file listing:

http://httpd.apache.org/docs/2.2/mod/mod_autoindex.html

To add a CSS link element to the listing, you can use the IndexStyleSheet or IndexHeadInsert directive in your .htaccess file:

http://httpd.apache.org/docs/2.2/mod/mod_autoindex.html#indexstylesheet
http://httpd.apache.org/docs/2.2/mod/mod_autoindex.html#indexheadinsert

Similarly, you could add some body HTML (logo, intro text, etc) with the HeaderName directive:

http://httpd.apache.org/docs/2.2/mod/mod_autoindex.html#headername


#5

Thanks so much for all the info - wondering tho - how do I get to the .htaccess file so that I can edit it? I’ve shown invisible files, it doesn’t appear - and I’ve tried just authoring a new .htaccess file and uploading it, but that breaks the site.

d


#6

You could use WebFTP to edit the .htaccess file in-place on the server: https://webftp.dreamhost.com

On WebFTP, once you have logged in and navigated to the .htaccess file, select it and choose Open in… > Choose Other > Text Editor. Now you can modify the .htaccess and save it.

Note: If the .htaccess file was created by DH (say via https://panel.dreamhost.com/index.cgi?tree=goodies.webdav), then you would have to first use WebFTP to change the permissions on the .htaccess file to allow your user to edit the file.


#7

This is incorrect information.

Dreamhost’s webftp has a limitation that hides hidden files. (those files whose names begin with a . ) You must use a full ftp client such as filezilla, fireftp, winscp, etc to edit this file. If a .htaccess doesn’t yet exist you can upload one via webftp, but you can NOT edit at an existing using webftp.


#8

Actually, because I wasn’t very familiar with WebFTP, I tested editing and changing permission on a .htaccess file with WebFTP before posting and it all worked.

I know the htaccess article in the DH wiki says it isn’t possible (http://wiki.dreamhost.com/Htaccess#Finding_.htaccess_Files), but it also noted that “[its] developers are hard at work on a solution.” They must have found a solution!