.htacccess – deny from all, excludes images

0
.htacccess – deny from all, excludes images
5 (100%) 1 vote

Sometime, when you upgrade or update your website, you want to deny all access from internet, but when you deny access, it also deny access to images and css file, so if there is a maintenance page, and use css and / or images in that page, it will be blocked. So here is solution.
You can block all access to your site, accept only some IP for you and your friend in Apache (Mod Rewrite) using .htaccess. For example in the code below, we deny all access from internet, only accept access from 3 IP: 12.34.56.78 , 10.20.30.40 and 50.60.70.80

So, now we need unblock for all images and css file, then noone blocked from these files type:

So, final code will look like:

 

 

Last update: 05:07:45 AM, 25th December 2017
Share.

About Author

Leave A Reply