Welcome Guest, Not a member yet? Register   Sign In
.htaccess works in root but not in subfolder
#1

[eluser]MaartenDeGroote[/eluser]
Hi everyone,

I've got a .htaccess rewrite setup in the root level of my local environment. This works fine. Now I'm trying to setup a .htacess basic authentication for a subfolder inside the controllers folder. However, it seems like the .htaccess is just being ignored. The browser doesn't prompt for a pass and also doesn't give internal server errors when the .htaccess isn't valid.

Did anyone encounter the same problem before? Is this a apache config issue?
from the httpd.conf file:

Code:
LoadModule auth_basic_module modules/mod_auth_basic.so
#LoadModule auth_digest_module modules/mod_auth_digest.so

All help is appreciated. Thanx!

Martin
#2

[eluser]jedd[/eluser]
Hi Martin,

No - it's not an apache configuration issue.

You can't do what you're trying to do here - because Apache isn't serving your controller from your sub-folder. That controller is being loaded by the CI infrastructure - basically the index.php in the root of your CI installation.
#3

[eluser]MaartenDeGroote[/eluser]
Jedd,

Thanx for your reply.
Is there an alternative solution?
#4

[eluser]InsiteFX[/eluser]
Also for protection on folders it's not .htaccess it's htpasswd

Enjoy
InsiteFX
#5

[eluser]jedd[/eluser]
[quote author="Martin Klaarbeek" date="1251140993"]Jedd,

Thanx for your reply.
Is there an alternative solution?[/quote]

Well, if you want granularity beyond the All Or Nothing approach, then you'll have to investigate an authentication system.

There are a bunch of very competent and well documented ones (check the wiki), there's a new one that you can easily massage to suit your requirements ([url="https://github.com/thody/User-Library/tree"]https://github.com/thody/User-Library/tree[/url]) or you can do what most people end up doing - write your own.




Theme © iAndrew 2016 - Forum software by © MyBB