-1

I'm trying to prevent access images folder on my the website with .htaccess here is my folder http://192.168.1.55/onlineshop/images/

AbdeAMNR
  • 165
  • 1
  • 5
  • 18

3 Answers3

0

if .htaccess file is not working than you can add index.html file in your folder with content of forbidden access, while anyone open's that url than index.html file will run. So your folder is prevent from direct use.

Hope this will helps you.

Nirav Joshi
  • 2,924
  • 1
  • 23
  • 45
0

create .htaccess file in images folder i.e http://192.168.1.55/onlineshop/images/.htaccess and add below code in .htaccess file

Deny from all
Nadeem Shaikh
  • 289
  • 2
  • 13
0

Create .htaccess in that folder with the following content.

Deny from all

Codeformer
  • 2,060
  • 9
  • 28
  • 46
  • it work but , how can display a message instead of forbidden message – AbdeAMNR Jun 16 '17 at 05:44
  • To show some custom message , Add this in htaccess file: ErrorDocument 403 /path/to/403.html – Codeformer Jun 16 '17 at 05:47
  • That will show content from that HTML file instead of the standard forbidden message. – Codeformer Jun 16 '17 at 05:48
  • Hi @AbdeAMNR if this or any answer has solved your question please consider [accepting it](https://meta.stackexchange.com/q/5234/179419) by clicking the check-mark. This indicates to the wider community that you've found a solution and gives some reputation to both the answerer and yourself. There is no obligation to do this. – Codeformer Jun 16 '17 at 06:14