The .htaccess file is a directory recursive configuration file for UNIX.
This file may or may not be allowed for use or may be restricted in what
directives you may override due to server configurations set by the
systems administrator. It can be used in any directory and controls
everything under it until encountering another .htaccess file. Though
the .htaccess is allowed in any/all/none of your directories it may be
easier to use <directory > </directory >. Familiar?
<Directory /users/* >
Options +IncludesNOEXEC -ExecCGI
</Directory >
You can put everything in top folders. Much better.
Applies only to the named directory and its subs
One thing to remember, its * not *.*
For more complete information on the .htaccess file and the directives
allowed see:
http://www.apache.org/docs/mod/directives.html
http://hoohoo.ncsa.uiuc.edu/
If you are going to be using the .htaccess file much you should check out
AllowOverride. It is "All " by default but if you are going to juggle
users or page owners with browser web editing/uploading you may find it
useful (and more secure). But for just a solo webmaster you dont have to
worry about it.
Here are some of the more common directives normally available to UNIX
system Virtual Domain webmasters. There are many sites that have
authentication and allow/deny tutorials so I wont go over those.
Redirect old new
MULTIPLE allowed in the form of
old: /path/from/dir/containing/.htaccess
new: http://domain.com/blah
ex. Redirect /fish/fish.htm http://hometown.net/fish/index.html
Redirects should be placed in your top folder .htaccess file.
ErrorDocument error# display_file
MULTIPLE allowed
ex. ErrorDocument 404 /error/404.htm
display_file can be any file or external
link. Text may also be displayed. Note: only
a preceding "
ex. ErrorDocument 500 "wuh! what a script!
302 - REDIRECT
400 - BAD_REQUEST
401 - AUTH_REQUIRED
403 - FORBIDDEN
404 - NOT_FOUND
500 - SERVER_ERROR
501 - NOT_IMPLEMENTED
When a CGI script is called these ENV$ are added
REDIRECT_REQUEST, request sent to server
REDIRECT_URL, url that cause the error
REDIRECT_STATUS, error # and default server output
DirectoryIndex file1 file 2 ...
ONE allowed
sets the default top page in a folder
ex. DirectoryIndex index.htm index.html
Indexing
When http://somewhere.com/here/ is sent, because
no file was specified the directory index is shown.
This is a very good way to put a large number of
files in front of clients,vendors, users, etc. in a
format they are familiar with.
FancyIndex on off ex. FancyIndex off
ONE allowed
Enable/disable icons and file size
ReadmeName display_file ex. ReadmeName readme.txt
ONE allowed
Ever wonder why a readme is first in lists?
a .html file is looked for first so if using only
ex. ReadmeName readme
and there existed a readme and a readme.html the html file
be listed inline first followed by readme.
HeaderName display_file
ONE allowed
just like ReadmeName except displayed at top of index.
Can contain HTML, traditionally this is a <h# >header </h# >
but who says it cant contain a <img src > for a logo.
AddDescription "description string " file_name
MULTIPLE allowed
ex. AddDescription "Leaping Lemmings backdropped by White
Cliffs " lemming.jpg
file_name can be an extension, filename, path or wildcard.
IndexIgnore pattern1 pattern2 ...
ONE allowed
pattern can be any extension or file name
wildcards are allowed
So, * or /* stops the display
Use the Option directive to shut indexing off and create a 404
Options allow you to control multiple actions with one directive entry.
Options +/-|option1 +/-|option2
ex. Options -ExecCGI +IncludesNOEXEC
+ or - is used to allow or deny. An
action used bare is taken to be +.
It's a good idea to use +/- if using
one main .htaccess file with the
<directory > </directory >
These are the options that will be of use for a VD
ExecCGI
Execution of CGI scripts is permitted.
Includes
Server-side includes are permitted.
IncludesNOEXEC
Server-side includes are permitted, but the #exec
command and #include of CGI scripts are disabled.
Indexes
If a URL which maps to a directory is requested, and
the there is no DirectoryIndex (e.g. index.html)
in that directory, then the server will return a
formatted listing of the directory.
There are some other option actions that you will find at the sites shown
above to change icons.
END
_______________________________________________
http://linux.nf -- [EMAIL PROTECTED]
Archives, Subscribe, Unsubscribe, Digest, Etc
->http://linux.nf/mailman/listinfo/linux-users