.htaccess

.htaccess

In several web servers (most commonly Apache), .htaccess ("hypertext access") is the default name of directory-level configuration files. A .htaccess file is placed in a particular directory, and the directives in the .htaccess file apply to that directory, and all subdirectories thereof. It provides the ability to customize configuration for requests to the particular directory. The file name starts with a dot because dot-files are by convention hidden files on Unix-like operating systems. A subset of Apache's .htaccess syntax is also supported by other web servers, such as Sun Java System Web Server and Zeus Web Server.

Common usage

; Authorization, authentication: .htaccess files are often used to specify the security restrictions for the particular directory, hence the filename "access." The .htaccess file is often accompanied by an .htpasswd file which stores valid usernames and their passwords.; Customized error responses: Changing the page that is shown when a server-side error occurs, for example HTTP 404 Not Found.; Rewriting URLs: Servers often use .htaccess to rewrite "ugly" URLs to shorter and prettier ones.; Cache Control: .htaccess files allow a server to control User agent caching used by web browsers to reduce bandwidth usage, server load, and perceived lag.

When .htaccess files should be used

For servers with multiple users, as is common in shared web hosting plans, it is often desirable to allow individual users the ability to alter their site configuration. In general, .htaccess files should be used by users who do not have access to the main server configuration files. [cite web | url = http://httpd.apache.org/docs/2.2/howto/htaccess.html#when | title = Apache Tutorial: When (not) to use .htaccess files | accessdate = 2008-01-12]

When .htaccess files should not be used

To control Apache, using the main server configuration file httpd.conf [cite web | url=http://httpd.apache.org/docs/2.2/configuring.html | title=Configuration Files - Apache HTTP Server | accessdate=2008-01-12] is preferred for security and performance reasons: [ [http://httpd.apache.org/docs/2.0/howto/htaccess.html#when When Not to use .htaccess files] ]

; Performance loss : For each HTTP request there are additional file-system accesses for every parent directory when using .htaccess.; Security : Allowing individual users to modify the configuration of a server can cause security concerns if not set up properly.

ee also

*Rewrite engine
*Sun Java System Web Server
*Apache HTTP Server
*Configuration file

References

External links

* [http://httpd.apache.org/docs/trunk/howto/htaccess.html Apache Docs Tutorial: .htaccess files]
* [http://www.htaccess-guide.com/ .htaccess Tutorial and Examples]
* [http://www.javascriptkit.com/howto/htaccess.shtml Comprehensive guide to .htaccess]
* [http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html mod_rewrite Reference]
* [http://www.askapache.com/htaccess/apache-htaccess.html 500 usage examples for .htaccess]
* [http://www.htaccessbasics.com/ Htaccess Basics]
*dmoz|Computers/Internet/Web_Design_and_Development/Authoring/FAQs,_Help,_and_Tutorials/Access_Control


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Htaccess — Les fichiers .htaccess sont des fichiers de configuration des serveurs web Apache. Ils peuvent être placés dans n importe quel répertoire du site web (la configuration s applique au répertoire et à tous les répertoires qu il contient, qui n ont… …   Wikipédia en Français

  • .htaccess — (от. англ. hypertext access) файл дополнительной конфигурации веб сервера Apache, а также подобных ему серверов. Позволяет задавать большое количество дополнительных параметров и разрешений для работы веб сервера в отдельных каталогах… …   Википедия

  • Htaccess — (engl. hypertext access „Hypertext Zugriff“) ist eine Konfigurationsdatei, in der verzeichnisspezifische Einstellungen auf NCSA kompatiblen Webservern (z. B. Apache) vorgenommen werden können. Beispielsweise lässt sich dort ein Zugriffsschutz für …   Deutsch Wikipedia

  • .htaccess — (engl. hypertext access „Hypertext Zugriff“) ist eine Konfigurationsdatei, in der verzeichnisspezifische Einstellungen auf NCSA kompatiblen Webservern (z. B. Apache) vorgenommen werden können. Beispielsweise lässt sich dort ein… …   Deutsch Wikipedia

  • Htaccess — Dateien sind Konfigurationsdateien für Apache Webserver. Sie ermöglichen es z.B., Webseiten und Verzeichnisse vor unberechtigten Zugriffen zu schützen oder Umleitung für Anfragen bestimmter User Agents anzulegen. Man kann mit Ihnen auch… …   SEO Wörterbuch

  • .htaccess — Les fichiers .htaccess sont des fichiers de configuration des serveurs web Apache. Ils peuvent être placés dans n importe quel répertoire du site web (la configuration s applique au répertoire et à tous ceux qu il contient n ayant pas de tel… …   Wikipédia en Français

  • .htaccess — Un fichero .htaccess (hypertext access), también conocido como archivo de configuración distribuida, es un fichero especial, popularizado por el Servidor HTTP Apache que permite definir diferentes directivas de configuración para cada directorio… …   Wikipedia Español

  • Htaccess — …   Википедия

  • .htpasswd — htaccess (engl. hypertext access „Hypertext Zugriff“) ist eine Konfigurationsdatei, in der verzeichnisspezifische Einstellungen auf NCSA kompatiblen Webservern (z. B. Apache) vorgenommen werden können. Beispielsweise lässt sich dort ein… …   Deutsch Wikipedia

  • Domainweiterleitung — Eine Domainweiterleitung (URL forward) wird verwendet, um eine Domain (z. B. example.net ) an eine andere Hostadresse (z. B. example.com ) weiterzuleiten. Dabei kann gezielt nur der Domainname ersetzt werden. So lässt sich… …   Deutsch Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”