Browse Source

Added .htaccess

Jesús 2 months ago
parent
commit
78b9504457
Signed by: Jesús <heckyel@hyperbola.info> GPG Key ID: F6EE7BC59A315766
2 changed files with 41 additions and 1 deletions
  1. 40
    0
      content/.htaccess
  2. 1
    1
      pelicanconf.py

+ 40
- 0
content/.htaccess View File

@@ -0,0 +1,40 @@
1
+# Extra Security Headers
2
+<IfModule mod_headers.c>
3
+    Header set X-XSS-Protection "1; mode=block"
4
+    Header always append X-Frame-Options SAMEORIGIN
5
+    Header set X-Content-Type-Options nosniff
6
+    # DISABLE CACHING
7
+    # Header set Cache-Control "no-cache, no-store, must-revalidate"
8
+    # Header set Pragma "no-cache"
9
+    # Header set Expires 0
10
+</IfModule>
11
+
12
+<IfModule mod_rewrite.c>
13
+    RewriteEngine On
14
+    RewriteBase /
15
+    RewriteRule ^index\.php$ - [L]
16
+    RewriteCond %{REQUEST_FILENAME} !-f
17
+    RewriteCond %{REQUEST_FILENAME} !-d
18
+    RewriteRule . /index.php [L]
19
+
20
+    # Rewrite HTTP to HTTPS
21
+    RewriteCond %{HTTPS} !=on
22
+    RewriteRule ^(.*) https://%{SERVER_NAME}/$1 [R,L]
23
+</IfModule>
24
+
25
+ErrorDocument 404 /404.html
26
+
27
+# BEGIN EXPIRES
28
+<IfModule mod_expires.c>
29
+    ExpiresActive On
30
+    ExpiresByType text/plain "access plus 1 minute"
31
+    ExpiresByType text/vtt "access plus 1 year"
32
+    ExpiresByType text/css "access plus 1 year"
33
+    ExpiresByType image/jpg "access plus 1 year"
34
+    ExpiresByType image/jpeg "access plus 1 year"
35
+    ExpiresByType image/gif "access plus 1 year"
36
+    ExpiresByType image/png "access plus 1 year"
37
+    ExpiresByType text/html "access plus 600 seconds"
38
+    ExpiresDefault "access plus 1 year"
39
+</IfModule>
40
+# END EXPIRES

+ 1
- 1
pelicanconf.py View File

@@ -49,7 +49,7 @@ AUTHORS_URL     = 'pages/créditos/'
49 49
 AUTHORS_SAVE_AS = 'pages/créditos/index.html'
50 50
 ARCHIVES_URL     = 'archives/'
51 51
 ARCHIVES_SAVE_AS = 'archives/index.html'
52
-STATIC_PATHS = ['asciicasts', 'heckyel_pub.asc', 'robots.txt', 'wp-content', 'vendor']
52
+STATIC_PATHS = ['.htaccess', 'asciicasts', 'heckyel_pub.asc', 'robots.txt', 'wp-content', 'vendor']
53 53
 PAGE_EXCLUDES = ['asciicasts', 'wp-content', 'vendor']
54 54
 ARTICLE_EXCLUDES = ['asciicasts', 'wp-content', 'vendor']
55 55