From 78b95044577a6d152b7ea81915187c325fb0d13a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs?= Date: Mon, 23 Sep 2019 23:17:00 -0500 Subject: [PATCH] Added .htaccess --- content/.htaccess | 40 ++++++++++++++++++++++++++++++++++++++++ pelicanconf.py | 2 +- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 content/.htaccess diff --git a/content/.htaccess b/content/.htaccess new file mode 100644 index 0000000..0da9c61 --- /dev/null +++ b/content/.htaccess @@ -0,0 +1,40 @@ +# Extra Security Headers + + Header set X-XSS-Protection "1; mode=block" + Header always append X-Frame-Options SAMEORIGIN + Header set X-Content-Type-Options nosniff + # DISABLE CACHING + # Header set Cache-Control "no-cache, no-store, must-revalidate" + # Header set Pragma "no-cache" + # Header set Expires 0 + + + + RewriteEngine On + RewriteBase / + RewriteRule ^index\.php$ - [L] + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d + RewriteRule . /index.php [L] + + # Rewrite HTTP to HTTPS + RewriteCond %{HTTPS} !=on + RewriteRule ^(.*) https://%{SERVER_NAME}/$1 [R,L] + + +ErrorDocument 404 /404.html + +# BEGIN EXPIRES + + ExpiresActive On + ExpiresByType text/plain "access plus 1 minute" + ExpiresByType text/vtt "access plus 1 year" + ExpiresByType text/css "access plus 1 year" + ExpiresByType image/jpg "access plus 1 year" + ExpiresByType image/jpeg "access plus 1 year" + ExpiresByType image/gif "access plus 1 year" + ExpiresByType image/png "access plus 1 year" + ExpiresByType text/html "access plus 600 seconds" + ExpiresDefault "access plus 1 year" + +# END EXPIRES diff --git a/pelicanconf.py b/pelicanconf.py index 42f9c21..45f283f 100644 --- a/pelicanconf.py +++ b/pelicanconf.py @@ -49,7 +49,7 @@ AUTHORS_URL = 'pages/créditos/' AUTHORS_SAVE_AS = 'pages/créditos/index.html' ARCHIVES_URL = 'archives/' ARCHIVES_SAVE_AS = 'archives/index.html' -STATIC_PATHS = ['asciicasts', 'heckyel_pub.asc', 'robots.txt', 'wp-content', 'vendor'] +STATIC_PATHS = ['.htaccess', 'asciicasts', 'heckyel_pub.asc', 'robots.txt', 'wp-content', 'vendor'] PAGE_EXCLUDES = ['asciicasts', 'wp-content', 'vendor'] ARTICLE_EXCLUDES = ['asciicasts', 'wp-content', 'vendor']