1

I wrote this script to deny all exept index.php

Order allow,deny
Deny from All

<Files *>
  Order Deny,Allow
  Deny from all
</Files>

<Files index.php>
  Order Deny,Allow
  Allow from all
</Files>

However links like http://mywebsite.com/image.jpg are still shown. How is that possible?

Trouble
  • 428
  • 3
  • 21
  • What do you mean by "links are still shown?" `.htaccess` won't change links. What it will change is how the server responds to a request to a specific file/directory. What do you see when you visit a page that's not index.php? – JSuar Mar 20 '13 at 13:24
  • other pages gives error, but when you request /image.jpg it is not error. I want to deny all, including images. – Trouble Mar 20 '13 at 13:26
  • Do you want to provide access to files via index.php (such as image files)? If not, change the top `Order allow,deny` to `Order deny,allow`. – JSuar Mar 20 '13 at 13:43
  • Than I can't go to index.php and the image is still visible. I want to deny everything exept index.php, which is not loading any images from the folder. – Trouble Mar 20 '13 at 14:15
  • That's what I thought. The following link will provide the solution you need. I tested it and it worked. Keep in mind you might need to do a hard refresh to clear your browser's cache. http://stackoverflow.com/a/10236791/1085891 – JSuar Mar 20 '13 at 14:25
  • Did that last suggestion work? – JSuar Mar 21 '13 at 15:17

0 Answers0