Welcome Guest, Not a member yet? Register   Sign In
how do i get to restrict access to my folders
#1

[eluser]ebuoe[/eluser]
hello ... am building a website with a lot of image galleries , i store the images in folders ,but i want to restrict access to the folders via url .i.e i don't want people to have access to my image folder using a url like this::

http://website/all_images/

all images is the folder that contains the image folder .. i tried using a htaccess file

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^CI_system.*
RewriteRule ^(.*)$ /website/index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|all_images)
RewriteRule ^(.*)$ /website/index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>

ErrorDocument 404 /index.php
</IfModule>

the rewrite condition for the index.php works well but i still get access to all my folders via the url
#2

[eluser]InsiteFX[/eluser]
Code:
// Read and write for owner, nothing for everybody else
&lt;?php chmod("/somedir/somefile", 0600);?&gt;

You can also do this with an FTP Program!

InsiteFX
#3

[eluser]ebuoe[/eluser]
thanks culdn't figure out a way to apply your method ... i put index.php files in all the image folders but i will still find a way to implement yours it seems more efficient to you




Theme © iAndrew 2016 - Forum software by © MyBB