Answer the question
In order to leave comments, you need to log in
Authorization via .htaccess?
On the site I made authorization using the Apache module auth_form_module through .htaccess
It is written in .htaccess
Session On
SessionCookieName session path=/
SessionMaxAge 86400
#SessionCryptoPassphrase secret
AuthFormProvider file
AuthName "authenticationform"
AuthType form
AuthUserFile www/path_to_domains/login/passwords
AuthFormFakeBasicAuth On
ErrorDocument 401 "/log/aulogin.html"
Require valid-user
<Files "/log/aulogin.html">
Allow from all
</Files>
ErrorDocument 404 /errdoc.php
#RequestHeader set X-Remote-User expr=%{REMOTE_USER}
# Кеширование #
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 month"
# cache.appcache needs re-requests in FF 3.6 (thanks Remy ~Introducing HTML5)
ExpiresByType text/cache-manifest "access plus 0 seconds"
# html
ExpiresByType text/html "access plus 0 seconds"
# XML
ExpiresByType text/xml "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
# RSS
ExpiresByType application/rss+xml "access plus 1 hour"
# Favicon
ExpiresByType image/x-icon "access plus 1 week"
# Картинки
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
# HTC файлы (например css3pie)
ExpiresByType text/x-component "access plus 1 month"
# Нестандартные шрифты сайта
ExpiresByType application/x-font-ttf "access plus 1 month"
ExpiresByType font/opentype "access plus 1 month"
ExpiresByType application/x-font-woff "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
# CSS и javascript
ExpiresByType text/css "access plus 1 year"
ExpiresByType application/javascript "access plus 1 year"
</IfModule>
# Cache-Control браузера
<ifModule mod_headers.c>
# 30 дней
<filesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$">
Header set Cache-Control "max-age=2592000, public"
</filesMatch>
# 30 дней
<filesMatch "\.(css|js)$">
Header set Cache-Control "max-age=2592000, public"
</filesMatch>
# 2 дня
<filesMatch "\.(xml|txt)$">
Header set Cache-Control "max-age=172800, public, must-revalidate"
</filesMatch>
# 1 день
<filesMatch "\.(html|htm|php)$">
Header set Cache-Control "max-age=172800, private, must-revalidate"
</filesMatch>
</ifModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
############################################################################
#### Убираем повторяющиеся слеши (/) в URL ####
############################################################################
RewriteCond %{REQUEST_URI} ^(.*)/{2,}(.*)$
#Проверяем, повторяется ли слеш (//) более двух раз.
RewriteRule . %1/%2 [R=301,L]
#Исключаем все лишние слеши.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-s
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ /index.php?%{QUERY_STRING} [L]
# RewriteRule ^(.+)$ /errdoc.php?%{QUERY_STRING} [L]
</IfModule>
php_flag register_globals off
php_flag magic_quotes_gpc off
php_value display_errors 1
php_value error_reporting 2047
Answer the question
In order to leave comments, you need to log in
We just tried it: it turns out that if you enable php in module mode, then authorization passes, but if it’s like CGI, it doesn’t work
CGIPassAuth on
www/path_to_domains/login/passwords - you need a full path from the root
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question