This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine on | |
# Redirect to domain with www. | |
RewriteCond %{HTTPS} off | |
RewriteCond %{HTTP_HOST} !^www\. [NC] | |
RewriteRule .* http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] | |
# Same for HTTPS: | |
RewriteCond %{HTTPS} on | |
RewriteCond %{HTTP_HOST} !^www\. [NC] | |
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine on | |
# Redirect to domain without www. | |
RewriteCond %{HTTPS} off | |
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] | |
RewriteRule .* http://%1%{REQUEST_URI} [R=301,L] | |
# Same for HTTPS: | |
RewriteCond %{HTTPS} on | |
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] | |
RewriteRule .* https://%1%{REQUEST_URI} [R=301,L] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine on | |
# Redirect to another domain: www.sitodidestinazione.it. | |
RewriteCond %{HTTPS} off | |
RewriteCond %{HTTP_HOST} !^(www\.)?sitodidestinazione\.it$ [NC] | |
RewriteRule .* http://www.sitodidestinazione.it%{REQUEST_URI} [R=301,L] | |
# Same for HTTPS: | |
RewriteCond %{HTTPS} on | |
RewriteCond %{HTTP_HOST} !^(www\.)?sitodidestinazione\.it$ [NC] | |
RewriteRule .* https://www.sitodidestinazione.it%{REQUEST_URI} [R=301,L] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine on | |
# Ensure all directory URLs have a trailing slash. | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_URI} !\/$ | |
RewriteCond %{REQUEST_URI} !\/[^\/]*\.[^\/]+$ | |
RewriteRule .* http://%{HTTP_HOST}%{REQUEST_URI}/ [L,R=301] | |
# Same for HTTPS: | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_URI} !\/$ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 301 Redirect URLs. | |
Redirect 301 /www.urlprima.it /www.urldopo.it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine on | |
# Stop hotlinking. | |
RewriteCond %{HTTP_REFERER} !^$ | |
RewriteCond %{HTTP_REFERER} ^https?://([^/]+)/ [NC] | |
RewriteCond %1#%{HTTP_HOST} !^(.+)#\1$ | |
RewriteRule \.(jpg|jpeg|png|gif|swf|svg)$ - [NC,F,L] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add Caching. | |
<FilesMatch ".(ico|jpg|jpeg|png|gif|js|css|swf)$"> | |
Header set Cache-Control "max-age=3600" | |
</FilesMatch> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Compress text, html, javascript, css, xml: | |
AddOutputFilterByType DEFLATE text/plain | |
AddOutputFilterByType DEFLATE text/html | |
AddOutputFilterByType DEFLATE text/xml | |
AddOutputFilterByType DEFLATE text/css | |
AddOutputFilterByType DEFLATE application/xml | |
AddOutputFilterByType DEFLATE application/xhtml+xml | |
AddOutputFilterByType DEFLATE application/rss+xml | |
AddOutputFilterByType DEFLATE application/javascript | |
AddOutputFilterByType DEFLATE application/x-javascript |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Esegui questo comando se vuoi cancellare tutti i commenti in attesa di moderazione (pending). Per lanciare il comando per prima cosa seleziona il tuo database, poi naviga nella tab SQL, inserisci la query e premi Esegui. | |
DELETE from wp_comments WHERE comment_approved = '0' | |
# Esegui questo comando se vuoi cancellare tutti i commenti precedentemente approvati. | |
DELETE from wp_comments WHERE comment_approved = '1' | |
# Esegui questo comando se vuoi cancellare tutti i commenti marcati come SPAM. | |
DELETE from wp_comments WHERE comment_approved = 'spam' | |
# Esegui questo comando se vuoi cancellare tutti i commenti nel cestino. |