Htaccess File

scorN17/modx-evo/master/.htaccess

DEFLATE, HTTP_HOST, HTTP_USER_AGENT, REQUEST_FILENAME
# -----------------------------------------------------------------------
  # For full documentation and other suggested options, please see
  # http://rtfm.modx.com/evolution/1.0/administration/friendly-url-solutions
  # including for unexpected logouts in multi-server/cloud environments
  # and especially for the first three commented out rules

  #php_flag register_globals Off
  AddDefaultCharset utf-8
  php_value date.timezone Europe/Moscow

  #Options +FollowSymlinks
  RewriteEngine On
  RewriteBase /

  # Fix Apache internal dummy connections from breaking [(site_url)] cache
  RewriteCond %{HTTP_USER_AGENT} ^.*internal dummy connection.*$ [NC]
  RewriteRule .* - [F,L]
  
  
  #------------------------------ REDIRECTS -------------------------------
  # Rewrite domain.com -> www.domain.com -- used with SEO Strict URLs plugin
  #RewriteCond %{HTTP_HOST} !^$
  #RewriteCond %{HTTP_HOST} !^www. [NC]
  #RewriteCond %{HTTP_HOST} (.+)$
  #RewriteRule ^(.*)$ http://www.%1/$1 [R=permanent,L] . 

  # without www
  #RewriteCond %{HTTP_HOST} .
  #RewriteCond %{HTTP_HOST} !^domain.ru [NC]
  #RewriteRule (.*) http://domain.ru/$1 [R=301,L]

  # without www all domains
  #RewriteCond %{HTTP_HOST} .
  #RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC]
  #RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
  #------------------------------ REDIRECTS -------------------------------

  # Exclude /assets and /manager directories and images from rewrite rules
  RewriteRule ^(manager|assets)/.*$ - [L]
  RewriteRule .(jpg|jpeg|png|gif|ico)$ - [L]

  # For Friendly URLs
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

  # Reduce server overhead by enabling output compression if supported.
  php_flag zlib.output_compression On
  php_value zlib.output_compression_level 9
  
  Options -indexes
  
  <IfModule mod_deflate.c>
      AddEncoding gzip .gz
      AddOutputFilterByType DEFLATE text/css
      AddOutputFilterByType DEFLATE text/javascript
      AddOutputFilterByType DEFLATE text/plain
      AddOutputFilterByType DEFLATE text/x-component
      AddOutputFilterByType DEFLATE text/xml
      AddOutputFilterByType DEFLATE application/x-javascript
      AddOutputFilterByType DEFLATE application/javascript
      AddOutputFilterByType DEFLATE application/json
      AddOutputFilterByType DEFLATE application/xml
      AddOutputFilterByType DEFLATE application/rss+xml
      AddOutputFilterByType DEFLATE application/atom+xml
      AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
      AddOutputFilterByType DEFLATE image/x-icon
      AddOutputFilterByType DEFLATE image/svg+xml
      AddOutputFilterByType DEFLATE font/truetype
      AddOutputFilterByType DEFLATE font/opentype
      AddOutputFilterByType DEFLATE font/ttf
      AddOutputFilterByType DEFLATE font/otf
      AddOutputFilterByType DEFLATE font/x-woff
  </IfModule>
  <IfModule mod_expires.c>
    ExpiresActive on
    ExpiresDefault A604800
    ExpiresByType image/jpeg A604800
    ExpiresByType image/gif A604800
    <FilesMatch .*.(shtml|html|phtml|php)$>
            ExpiresActive Off
    </FilesMatch>
  </IfModule>
# -----------------------------------------------------------------------
Exit mobile version