-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
executable file
·134 lines (111 loc) · 6.23 KB
/
.htaccess
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
AddCharset UTF-8 .html
AddCharset UTF-8 .php
AddCharset UTF-8 .js
AddCharset UTF-8 .csv
AddType application/vnd.ms-word.document.macroEnabled.12 docm
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
AddType application/vnd.ms-word.template.macroEnabled.12 dotm
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx
AddType application/vnd.ms-powerpoint.slideshow.macroEnabled.12 ppsm
AddType application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx
AddType application/vnd.ms-powerpoint.presentation.macroEnabled.12 pptm
AddType application/vnd.openxmlformats-officedocument.presentationml.presentation pptx
AddType application/vnd.ms-excel.sheet.binary.macroEnabled.12 xlsb
AddType application/vnd.ms-excel.sheet.macroEnabled.12 xlsm
AddType application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx
AddType application/vnd.ms-xpsdocument xps
IndexIgnore *
<IfModule mod_deflate.c>
# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/x-component
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE image/x-icon
</IfModule>
<IfModule php5_module>
php_value session.cookie_httponly true
</IfModule>
<IfModule mod_expires.c>
ExpiresActive on
# Perhaps better to whitelist expires rules? Perhaps.
ExpiresDefault "access plus 1 month"
# cache.appcache needs re-requests in FF 3.6 (thx Remy ~Introducing HTML5)
ExpiresByType text/cache-manifest "access plus 0 seconds"
# your document html
ExpiresByType text/html "access plus 0 seconds"
# data
ExpiresByType text/xml "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType application/json "access plus 0 seconds"
# rss feed
ExpiresByType application/rss+xml "access plus 1 hour"
# favicon (cannot be renamed)
ExpiresByType image/x-icon "access plus 1 week"
# media: images, video, audio
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType video/ogg "access plus 1 month"
ExpiresByType audio/ogg "access plus 1 month"
ExpiresByType video/mp4 "access plus 1 month"
ExpiresByType video/webm "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 month"
# htc files (css3pie)
ExpiresByType text/x-component "access plus 1 month"
# webfonts
ExpiresByType font/truetype "access plus 1 month"
ExpiresByType font/opentype "access plus 1 month"
ExpiresByType application/x-font-woff "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
# css and javascript
ExpiresByType text/css "access plus 2 months"
ExpiresByType application/javascript "access plus 2 months"
ExpiresByType text/javascript "access plus 2 months"
<IfModule mod_headers.c>
Header append Cache-Control "public"
</IfModule>
</IfModule>
RewriteEngine On
#CONDICIóN CUANDO SIEMPRE TIENE QUE SER HTTPS
#RewriteCond %{HTTP_HOST} !^$
#RewriteCond %{HTTP_HOST} !^www\. [NC]
#RewriteCond %{HTTPS}s ^on(s)|
#RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
#REGLA ESPECIAL PARA OPENID CON GOOGLE
RewriteRule ^login/?(\?([.\&]+))?$ index.php?pag=login&checkOpenID=cicatriz&$2 [L,QSA]
#URL FRIENDLY RULES - NODE ROOT - ADMIN
RewriteRule ^admin/kwsn/(api)/([\w\W\s]+)/?(\?([.\&]+))*?$ admin/index.php?action=KnightsWhoSayNi&pag=$2&mode=$1&$3$4 [L,QSA]
RewriteRule ^admin/kwsn/(li|lo|api)/([\w\W\s^\/]+)/([a-zA-Z0-9]+)$ admin/index.php?action=KnightsWhoSayNi&pag=$2&mode=$1&StokenOlif=$3 [L,QSA]
RewriteRule ^admin/kwsn/(li|lo)/([\w\W\s^\/]+)$ index.php?action=KnightsWhoSayNi&pag=$2&mode=$1 [L,QSA]
RewriteRule ^admin/$ admin/index.php?pag=admin/inicio [L,QSA]
RewriteRule ^admin/([\w\x26\x3DáéíóúAÉÍÓÚÑñ@_-]+)/([0-9]+)$ admin/index.php?pag=admin/$1&p=$2 [L,QSA]
RewriteRule ^admin/([\w\x26\x3D]+)/([0-9]+)$ admin/index.php?pag=admin/$1 [L,QSA]
RewriteRule ^admin/([^./]{3}[^.]*)$ admin/index.php?pag=admin/$1 [L,QSA]
#URL FRIENDLY RULES
#RewriteRule ^kwsn/(li|lo)/([\w\W\s^\/]+)/([a-zA-Z0-9]+)$ index.php?action=KnightsWhoSayNi&pag=$2&mode=$1&StokenOlif=$3 [L,QSA]
RewriteRule ^kwsn/(api)/([\w\W\s]+)/?(\?([.\&]+))*?$ index.php?action=KnightsWhoSayNi&pag=$2&mode=$1&$3$4 [L,QSA]
RewriteRule ^kwsn/(li|lo|api)/([\w\W\s^\/]+)/([a-zA-Z0-9]+)$ index.php?action=KnightsWhoSayNi&pag=$2&mode=$1&StokenOlif=$3 [L,QSA]
RewriteRule ^kwsn/(li|lo)/([\w\W\s^\/]+)$ index.php?action=KnightsWhoSayNi&pag=$2&mode=$1 [L,QSA]
RewriteRule ^([\w\W\s]+)/([0-9]+)$ index.php?pag=$1&p=$2 [L,QSA]
RewriteRule ^([\w\W\s]+)/([0-9]+)&([\w\W\s]+)$ index.php?pag=$1&p=$2&$3 [L,QSA]
RewriteRule ^([^./]{3}[^.]*)$ index.php?pag=$1 [L,QSA]