2.13.3.4. Standard .htaccess for Bitrix

The content of the standard .htaccess for 1C-Bitrix: Site Management:

  1. Options -Indexes
  2. ErrorDocument 404 /404.php
  3.  
  4. <IfModule mod_php5.c>
  5. php_flag session.use_trans_sid off
  6. #php_flag default_charset UTF-8
  7. #php_value display_errors 1
  8. </IfModule>
  9.  
  10. <IfModule mod_php7.c>
  11. php_flag session.use_trans_sid off
  12. #php_flag default_charset UTF-8
  13. #php_value display_errors 1
  14. </IfModule>
  15.  
  16. <IfModule mod_rewrite.c>
  17. Options +SymLinksIfOwnerMatch
  18. RewriteEngine On
  19. RewriteCond %{REQUEST_FILENAME} !-f
  20. RewriteCond %{REQUEST_FILENAME} !-l
  21. RewriteCond %{REQUEST_FILENAME} !-d
  22. RewriteCond %{REQUEST_FILENAME} !/bitrix/urlrewrite.php$
  23. RewriteRule ^(.*)$ /bitrix/urlrewrite.php [L]
  24. RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
  25. </IfModule>
  26.  
  27. <IfModule mod_dir.c>
  28. DirectoryIndex index.php index.html
  29. </IfModule>
  30.  
  31. <IfModule mod_expires.c>
  32. ExpiresActive on
  33. ExpiresByType image/jpeg "access plus 3 day"
  34. ExpiresByType image/gif "access plus 3 day"
  35. ExpiresByType image/png "access plus 3 day"
  36. ExpiresByType text/css "access plus 3 day"
  37. ExpiresByType application/javascript "access plus 3 day"
  38. </IfModule>

The directive on line 17 changed for compatibility with our hosting.

Content