.htaccess files and mod_rewrite
Contents
- Introduction to .htaccess files
- FileTypes
- Handlers
- URL Rewriting
- User authentication
- Host-based access control
- Directory indexing
Introduction to .htaccess files
Your Web directory and its subdirectories can contain per-directory configuration files called .htaccess files. Whenever Stronghold (our Web server) receives a request for a file, it first looks for a file called .htaccess in that directory and its parent directories. If one is present, Stronghold considers the configuration directives within it before responding to the request. A .htaccess file works like this:
- A .htaccess file must be a plain text file and contain no special formatting elements. Use a text editor to create your .htaccess file. If you create it with a word processor, be sure to save it as plain text.
- A .htaccess file contains a list of configuration directives and nothing else.
- If a .htaccess file contains any other information, it must be commented out in order to prevent errors
- A .htaccess file must be saved in the top directory to which you want it to apply. The directives apply to that directory and its subdirectories.
- If a subdirectory contains a .htaccess file, it overrides the .htaccess files of its parent directories.
- The directives themselves should occupy one line each, like this:
ErrorDocument 404 errors/404.html LanguagePriority en fr jp de CookieTracking off phpShowInfo on FancyIndexing on HeaderName header.html ReadmeName readme.html XBitHack full
Some valid .htaccess configuration directives are listed in the next sections. There are several types of configuration directives that control different server features.


Entries
Follow me!
Tutorial Introduction





