Skip to content

Instantly share code, notes, and snippets.

@bulentsakarya
Created October 10, 2018 23:08
Show Gist options
  • Save bulentsakarya/dc443c6a32559b85f82395b6986db375 to your computer and use it in GitHub Desktop.
Save bulentsakarya/dc443c6a32559b85f82395b6986db375 to your computer and use it in GitHub Desktop.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
RewriteCond %{HTTP_REFERER} !^http://siteadi.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://siteadi.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.siteadi.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.siteadi.com$ [NC]
RewriteCond %{HTTP_REFERER} !^https://siteadi.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^https://siteadi.com$ [NC]
RewriteCond %{HTTP_REFERER} !^https://www.siteadi.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^https://www.siteadi.com$ [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ https://www.siteadi.com [R,NC]
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
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/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresDefault "access plus 1 month"
</IfModule>
## EXPIRES CACHING ##
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment