.htaccess

(Redirected from Htaccess)
Jump to: navigation, search
Categories » Linux » Linux Software » Apache » .htaccess
Categories » Software » Linux Software » Apache » .htaccess
See also: Apache

Contents

Deny Access to a Subdirectory

Deny from all

Putting a site in "offline mode"

This puts a site in a temporary "offline mode" by redirecting all traffic to /offline.html. It provides an exception for specified IP addresses so you can still access the site while it appears "offline" for everyone else. [1]

RewriteEngine On
RewriteCond %{REMOTE_ADDR} !=123.45.67.89
RewriteCond %{REMOTE_ADDR} !=127.0.0.1
RewriteCond %{REQUEST_URI} !^/offline.html
RewriteRule ^.* /offline.html [R]

Directory indexes

TODO: Add more info to this section

IndexOptions DescriptionWidth=* FancyIndexing SuppressLastModified

Adding file descriptions

Apache directory indexes typically have a Description field. You can add data to this column by putting the following in an .htaccess file:

AddDescription "This is my first file" "File01.doc"
AddDescription "This is my second file" "File02.ppt"

References

Personal tools
Namespaces
Variants
Actions
Navigation
Categories
Toolbox