Welcome Guest, Not a member yet? Register   Sign In
Allowing Access To Directory Limited to Certain IP Range (.htaccess)
#1

[eluser]Unknown[/eluser]
Hello, I have a dir for file uploads that I'd like to make visible only to internal users.

I currently have this in my htaccess file to allow everyone to have access to dir's like css and js

Code:
#codeigniter
RewriteCond $1 !^(index\.php|images|robots\.txt|css|user_guide|assets)
RewriteRule ^(.*)$ ./index.php/$1 [L]

I can add uploads to that list but then it is accessible by everyone and i need to limit access to it from the ip range of 172.16.0.0/16.

I tried adding another rule like this

Code:
RewriteCond %{REMOTE_ADDR} ^172\.16\.0\.0
RewriteCond $1 !^(uploads)
RewriteRule ^(.*)$ ./index.php/$1 [L]

but it didn't work. Ideas?




Theme © iAndrew 2016 - Forum software by © MyBB