PDA

View Full Version : htaccess restrict access?



scottish
12-02-2009, 09:03 PM
Is there a way to restrict access through htaccess

atm i've set it up to require user/pass through .htpassword file and set to allow from me without password, but is there a way for either


User enters password and only has access to a specific folder and not full access
or


If incorrect password, redirects to a specific folder
?

thanks ^^

scottish
13-02-2009, 02:23 PM
Doesn't matter now; i just set up password protection, so when user fails to put in password they get 401 error so set up errordocument in htaccess to customised error which then redirects them to the section.

everything else didn't wanna work so i'll settle with it.

RewriteEngine on
RewriteCond %{REMOTE_ADDR} ^192\.168\.2\.3$ [OR]
RewriteCond %{REMOTE_ADDR} ^192\.168\.2\.2$
RewriteRule .* /shared [R=301]

anyway to make that so it'd redirect only the section, as that redirects anything on the server, so when it redirects to /shared it reloads again as its set to redirect them, anyway to do it so it won't redirect on /shared btu will on anything else? :P

i tried override on the /shared folder but meh that didn't work.

Want to hide these adverts? Register an account for free!