Skip to content

Instantly share code, notes, and snippets.

@carcam
Last active June 21, 2017 11:54
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save carcam/d09defe0cb054f2ddbd59c4e4fb3a672 to your computer and use it in GitHub Desktop.
Save carcam/d09defe0cb054f2ddbd59c4e4fb3a672 to your computer and use it in GitHub Desktop.
htaccess optimizado
### ===========================================================================
### Security Enhanced & Highly Optimized .htaccess File for Joomla!
### automatically generated by Admin Tools 3.6.8 on 2016-01-15 22:02:05 GMT
### Auto-detected Apache version: 2.5 (best guess)
### ===========================================================================
###
### The contents of this file are based on the same author's work "Master
### .htaccess", published on http://snipt.net/nikosdion/the-master-htaccess
###
### Admin Tools is Free Software, distributed under the terms of the GNU
### General Public License version 3 or, at your option, any later version
### published by the Free Software Foundation.
###
### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IMPORTANT !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
### !! !!
### !! If you get an Internal Server Error 500 or a blank page when trying !!
### !! to access your site, remove this file and try tweaking its settings !!
### !! in the back-end of the Admin Tools component. !!
### !! !!
### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
###
##### RewriteEngine enabled - BEGIN
RewriteEngine On
##### RewriteEngine enabled - END
## Send ETag (selected method: )
##### Rewrite rules to block out some common exploits -- BEGIN
RewriteCond %{QUERY_STRING} proc/self/environ [OR]
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
RewriteCond %{QUERY_STRING} base64_(en|de)code\(.*\) [OR]
RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule .* index.php [F]
##### Rewrite rules to block out some common exploits -- END
##### Advanced server protection rules exceptions -- BEGIN
##### Advanced server protection rules exceptions -- END
##### Advanced server protection -- BEGIN
##### Advanced server protection -- END
##### Joomla! core SEF Section -- BEGIN
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_URI} !^/index\.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L]
##### Joomla! core SEF Section -- END
# Compress output
AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-javascript application/javascript text/javascript application/x-font-ttf application/x-font-opentype image/svg+xml
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# Add correct content-type for fonts
AddType application/vnd.ms-fontobject .eot
AddType application/x-font-ttf .ttf
AddType application/x-font-opentype .otf
AddType application/x-font-woff .woff
ExpiresActive On
ExpiresByType image/png "access plus 12 days"
ExpiresByType image/jpeg "access plus 12 days"
ExpiresByType image/gif "access plus 12 days"
ExpiresByType image/svg+xml "access plus 12 days"
ExpiresByType image/x-icon "access plus 12 days"
ExpiresByType application/x-shockwave-flash "access plus 12 days"
ExpiresByType avideo/mp4 "access plus 12 days"
ExpiresByType text/css "access plus 12 days"
ExpiresByType text/javascript "access plus 12 days"
ExpiresByType application/javascript "access plus 12 days"
ExpiresByType application/x-javascript "access plus 12 days"
# Add a far future Expires header for fonts
ExpiresByType application/vnd.ms-fontobject "access plus 1 year"
ExpiresByType application/x-font-ttf "access plus 1 year"
ExpiresByType application/x-font-opentype "access plus 1 year"
ExpiresByType application/x-font-woff "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment