Comments on: .htaccess Deny from All: How to Restrict Site Access https://www.hostinger.ph/tutorials/htaccess/how-to-restrict-access-to-your-website-for-everyone-except-you Fri, 01 Mar 2024 21:52:00 +0000 hourly 1 https://wordpress.org/?v=6.5.2 By: Ignas R. https://www.hostinger.ph/tutorials/htaccess/how-to-restrict-access-to-your-website-for-everyone-except-you#comment-788761 Fri, 18 Aug 2023 07:39:05 +0000 http://blog.hostinger.io/hostinger-tutorials/uncategorized/htaccesshow-to-restrict-access-to-your-website-for-everyone-except-you/#comment-788761 In reply to Paulo Brito.

Hello there! Seems like it won’t be possible via .htaccess as instructed here. However, you can enable hotlink protection as guided here.

]]>
By: Paulo Brito https://www.hostinger.ph/tutorials/htaccess/how-to-restrict-access-to-your-website-for-everyone-except-you#comment-784827 Mon, 14 Aug 2023 14:57:59 +0000 http://blog.hostinger.io/hostinger-tutorials/uncategorized/htaccesshow-to-restrict-access-to-your-website-for-everyone-except-you/#comment-784827 I am trying to block the website css files from being downloaded using hacking tools.
But it is not working properly. Any suggestions? The css files are not accessible from anyone, ok, but it should be allowed to the website itself.

RewriteEngine On

# Block direct access to CSS files from external domains
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain\.com\.br [NC]
RewriteRule \.css$ – [NC,F]

# Allow internal access to all files
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ – [L]

ExpiresByType text/html “access 1 month”
ExpiresByType text/css “access 1 month”
ExpiresByType text/javascript “access 1 month”
ExpiresByType text/x-javascript “access 1 month”
ExpiresByType image/jpeg “access 1 year”
ExpiresByType image/jpg “access 1 year”
ExpiresByType image/png “access 1 year”
ExpiresByType image/svg “access 1 year”
ExpiresByType image/gif “access 1 year”
ExpiresByType application/pdf “access 1 month”
ExpiresByType application/javascript “access 1 month”
ExpiresByType application/x-javascript “access 1 month”
ExpiresByType application/xhtml+xml “access 1 month”
ExpiresByType application/x-shockwave-flash “access 1 month”
ExpiresByType image/x-icon “access 1 year”
ExpiresDefault “access 4 days”

]]>
By: Tomislav T. https://www.hostinger.ph/tutorials/htaccess/how-to-restrict-access-to-your-website-for-everyone-except-you#comment-150127 Tue, 25 Aug 2020 10:53:22 +0000 http://blog.hostinger.io/hostinger-tutorials/uncategorized/htaccesshow-to-restrict-access-to-your-website-for-everyone-except-you/#comment-150127 In reply to Ivan.

Hey there Ivan!
I believe what you are referring to is password protecting a directory!
If you are hosting via Hostinger, we have a a nice little tutorial to achieve that right here! 🙂

]]>
By: Ivan https://www.hostinger.ph/tutorials/htaccess/how-to-restrict-access-to-your-website-for-everyone-except-you#comment-144735 Tue, 11 Aug 2020 05:46:34 +0000 http://blog.hostinger.io/hostinger-tutorials/uncategorized/htaccesshow-to-restrict-access-to-your-website-for-everyone-except-you/#comment-144735 How do you setup a site password instead of the “deny access” process which keeps failing for me?

]]>