Options-Indexes
Processing of codes of answers of Apache Web-server
Any site not zatrakhovan from occurrence of mistakes. The most often mistake is transition under the link to nonexistent page. In this case Apache generates a code of the answer 404 and displays automatically generated page with the message on a mistake. Presence of nonexistent pages makes bad impression upon visitors of a site. This impression can be smoothed, if instead of standard pages, to substitute own pages with the message on a mistake. For purpose{appointment} of pages - obrabotchikov codes of the answer of report HTTP bears the responsibility ErrorDocument directive
ErrorDocument 401/401.html
ErrorDocument 403/403.html
ErrorDocument 404/404.html
ErrorDocument 500/500.html
After ErrorDocument directive it is necessary to specify a code of the answer and page on which it is necessary to redirect the visitor at occurrence of the given code of the answer.
401 mistake - Search demands autentifikacii the user (Unautorized).
403 mistake - Access to a required resource is forbidden (Forbidden).
404 mistake - the Required document on the server is absent (Not Found).
500 mistake - the Mistake of a configuration of the server or the external program (Internal Server Error).
To carry out code PHP in files HTML
Usually the PHP-code is carried out in files with expansions php. Sometimes there are situations when it is necessary to carry out a PHP-code in files with other expansion. In this case it is possible to give the instruction{indication} to the Web-server to carry out a PHP-code not only in files with expansion php, but also in files with expansion html.
RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html .phtml
The first line deletes obrabotchik files with expansions html and htm, and the second line informs the server on necessity to use for files with expansions htm and html obrabotchik PHP
The task of the coding of files for the server
The specified coding is sent a browser in heading Content-Type and will allow a browser of the client to be switched to the required coding automatically.
AddDefaultCharset Windows-1251
The task of the coding of loaded files
At loading files it is possible to specify the server, in what coding the server should expect a file.
CharsetSourceEnc windows-1251
Disconnect of MultiViews directive
Option MultiViews switched on on a hosting can call unexpected problems, for example, display of nonexistent pages of a site. We admit{allow}, on a site there is a page with the address http://www.sait.ru/down.php, <http: // www.internet-technologies.ru/? url=http%3A%2F%2Fwww.sait.ru%2Fdown.php%2C> and if visitors will address to the nonexistent catalogue http://www.sait.ru/down/, <http: // www.internet-technologies.ru/? url=http%3A%2F%2Fwww.sait.ru%2Fdown%2F%2C> that the switched on option MultiViews instead of this catalogue will substitute a file down.php. However substitution will be executed not completely - ways to images, to tables of styles will be, etc. substituted incorrectly. That is the page will be displayed with distortions. For suppression of such behaviour Apache option MultiViews should be disconnected.
Options-MultiViews
Interdiction of access to files
That visitors could not get access to service files from a window of a browser, it is possible to forbid access to such files. For this purpose the directive of interdiction Deny and sanctions of access Allow is used.
The note
Use of Deny directives and Allow operates only access to files from a browser, or from another the program - client. Similar interdictions are not distributed to scripts of the server.
Interdiction of access to files from a browser
Deny from all
At use of such directive access from a browser to all files and catalogues of the current catalogue will be forbidden.
Interdiction of access to the certain file
Deny from all
Here access only to files with a name config.php is forbidden.
Interdiction of access to files of expansion inc
Deny from all
* - any sequence of symbols, excepting a symbol of a slash (/).
To forbid access to files with several types of expansions
Deny from all
Access to files with expansion inc, conf and cfg is forbidden
To forbid access from the certain IP-address
Deny from 195.135.232.70
To resolve access only from the certain IP-address
Order deny, allow
Deny from all
Allow from 195.135.232.70
Order directive allows to set the order in which directives will be carried out. First the directive of an interdiction of access (Deny directive) is carried out, and then access that for 195.135.232.70 IP-address (Allow directive) is authorized. If in the first line to change the order of following of directives on Order allow, deny access for 195.135.232.70 IP-address will not open, since Deny directive which is carried out last, will block action of Allow directive.
The note
It is necessary to note, that the sanction of access from the certain IP-address sometimes can not work. For example, in the event that on a hosting return is established kehshirujuhhij the proxy-server. If directives of the sanction of access do not work, you need to address on this question in service of technical support of a hosting.

|