Welcome Guest, Not a member yet? Register   Sign In
htaccess assistance please :)
#1

[eluser]Bondie[/eluser]
Basically I want to password protect all my directories, with the exception of 2 directories, this includes i want all my pages from CI protected to, eg;

Quote:www.mysite.com/welcome (default view)

Here is my .htaccess in my public_html folder, at the moment

Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|robots\.txt|craig-knight|rick)
RewriteRule ^(.*)$ /index.php/$1 [L]

AuthUserFile "/home/my_user/.htpasswds/public_html/passwd"
AuthType Basic
AuthName "Recognise this?"

I know I can password all the contents just by using
Code:
Require valid-user
or just the one page with
Code:
<Files "index.php">
  Require valid-user
</Files>

so how do I password all but just allow 2 folders through;

www.mysite.com/craig-knight
-and-
www.mysite.com/rick

if anyone could help, my google skills failed Sad
#2

[eluser]TheFuzzy0ne[/eluser]
I'd suggest adding an htaccess file within each of the directories you want passworded.
#3

[eluser]Bondie[/eluser]
They're not directories, there dynamic urls produced by htaccess, default CI htaccess...

www.example.com/welcome -> is really -> www.example.com/index.php/welcome




Theme © iAndrew 2016 - Forum software by © MyBB