-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.htaccess
78 lines (77 loc) · 4.42 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
########################################################################
#Evitar HOTLINKING
########################################################################
#Cambia esto segun sea conveniente
RewriteEngine on
# Options +FollowSymlinks
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?tuenemigo.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?feedburner.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?google.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?bing.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?trollsinc.com/.*$ [NC]
RewriteRule \.(gif|jpg|jpeg|png|js|zip|css)$ - [F,NC,L]
########################################################################
#Mantener la conexión activa
<IfModule mod_headers.c>
Header set Connection keep-alive
</IfModule>
########################################################################
#Activar la cache al navegador
########################################################################
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"
########################################################################
#Trucos, borrar desde acá en si estas en un entorno de producción
########################################################################
# Optimiza la base de datos
# en wp-config.php pon: define('WP_ALLOW_REPAIR', true);
# luego ve a http://midominio.com/maint/repair.php
########################################################################
# Usar Bibliotecas
#Por ejemplo, si encuentras una línea de este tipo:
#<script src="http://midominio.com/scripts/ajax/libs/jquery/3.5.0/jquery.min.js"></script>
#Cámbiala para que se cargue el script desde Google:
#<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script>
########################################################################
# Vacía la papelera a menudo
#En wp-config.php pon: define( 'EMPTY_TRASH_DAYS', 7 );
########################################################################
# Desactiva las revisiones de entradas
#define('WP_POST_REVISIONS', false);
########################################################################
# Activa la compresión Gzip
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/ plain text/xml text/css application/x-javascript application/javascript
</ifmodule>
# Despues
#http://midominio.com/wp-admin/options.php
# cambiar el valor por 1
########################################################################
# Activa la cache de WordPress
# añadir la siguiente línea al archivo: wp-config.php: define( ‘ENABLE_CACHE’, true );
########################################################################
# Mod Pages Speed
# https://www.modpagespeed.com/doc/configuration
# wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb
# sudo dpkg -i mod-pagespeed-*.deb
# sudo apt-get -f install
########################################################################
# Activa la compresión CSS
#http://css.github.io/csso/csso.html
########################################################################
# Habilitar compresión para WordPress
<IfModule mod_deflate.c> AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/xml AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE text/javascript AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE application/rss+xml AddOutputFilterByType DEFLATE application/atom_xml AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE application/x-javascript AddOutputFilterByType DEFLATE application/x-shockwave-flash AddOutputFilterByType DEFLATE image/svg+xml .svg .svgz </IfModule>
########################################################################
# Habilitar más memoria para WordPress
#añadir la siguiente línea al archivo: wp-config.php: define('WP_MEMORY_LIMIT', '256M');
########################################################################