Here is the situation...
I have a cron job scheduled to run that is used to backup my database. Because of the way php is installed, I\'m having to use lynx to hit t
Require local
The local provider allows access to the server if any of the following conditions is true:
This allows a convenient way to match connections that originate from the local host:
Require local
Use the order the other way around, ie:
order deny,allow
deny from all
allow from 127.0.0.1
Leo's answer solved my issue. This is what I have set up so I can block direct access to images:
<IfModule mod_rewrite.c>
<Files ~ "\.(jpg|jpeg|png|gif|pdf|txt|bmp|mp4|mov|ogg|wmv|webm|flv|mpg|mp2|mpeg|mpe|mpv|m4p|m4v|mp3|wav|acc|oga|m4a)$">
order deny,allow
deny from all
Require local
allow from all
</Files>
</IfModule>
I didn't want to type out the ip, incase the local ip changed later
Try to add .htaccess file in your /assets/ folder with this content:
Options +Indexes
# or #
IndexIgnore *
This way you will see your folder empty in browser.
None of the answers here allowed me to access http://localhost:8888/ until I added this:
allow from localhost
So in my case this is my entire .htaccess
file:
order deny,allow
deny from all
# my IP
allow from xx.xx.xx.xx (use your own IP address here)
# Local development
allow from localhost
The #
is a code comment. This file allows only me to access the site from my browser online (the IP) and locally from localhost.
Remember, the order matters when you use order deny,allow
. You put the deny
ones first in your file and then your allow
s below that.