MyBB Community Forums

Full Version: htaccess lock
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How can I lock a subdomain down using htaccess except for my ip BUT leave the png files free. My current script looks like this:
AuthName "imgserv"
AuthType Basic
<Limit GET POST>
order deny,allow
deny from all
allow from 68.196.112.117
</Limit>
How can I lock down the directory using that but also have the png files free. Currently people get forbidden when attempting to view a picture with my htaccess intact. So, any help?
Try this:
AuthName "imgserv"
AuthType Basic
<Limit GET POST>
order deny,allow
deny from all
allow from 68.196.112.117

<FilesMatch "\.(gif|jpe?g|png)$">
allow from all
</FilesMatch>
</Limit>

Not sure if it will work though.
That should work.
(2011-06-10, 08:34 PM)Aries-Belgium Wrote: [ -> ]Try this:
AuthName "imgserv"
AuthType Basic
<Limit GET POST>
order deny,allow
deny from all
allow from 68.196.112.117

<FilesMatch "\.(gif|jpe?g|png)$">
allow from all
</FilesMatch>
</Limit>

Not sure if it will work though.

Nope, now it is denying me.
Is your IP static? It may have changed Smile
Try this then:
Order deny,allow
Deny from all
Allow from 68.196.112.117

<FilesMatch "\.(gif|jpe?g|png)$">
Allow from all
</FilesMatch>
(2011-06-10, 10:01 PM)Aries-Belgium Wrote: [ -> ]Try this then:
Order deny,allow
Deny from all
Allow from 68.196.112.117

<FilesMatch "\.(gif|jpe?g|png)$">
Allow from all
</FilesMatch>

Yes! That works, thank you! +Rep