[eluser]jedd[/eluser]
Quote:As I've rewritten the site, I've come to the problem where I still want to use the htaccess authentication on the /cms/ folder, which of course doesn't really exist because they are all using the index.php as a front controller.
If you mean you want to retain the .htpasswd contents, then this is relatively straightforward - see the link I posted earlier about pulling data out of those files - I think it uses a pretty simple php crypt() type function. If this is what you mean, is it because there's a lot of effort invested in the .htpasswd file? I reckon it'd be fairly easy to migrate that data out into a DB.
I'd suggest it would be time well spent to write a new and better auth system around this, though, especially if you're happy with using DB calls (and I get the impression that you are).
Quote:Let's assume you create a folder called /cms/, inside this there is the HTAccess authentication layer.
But at the same time there is a /cms/ controller within the CI framework.
Which takes presidence?
There's no precedence here, so much as CI's index.php is fronting
everything
The way htaccess works - as a component of your web server (Apache, say) - is that it blocks access at a file system level. This is simply not relevant with CI, because of this index.php routing that occurs. While your URL looks like it's a listing of subdirectories, it's in fact never getting past index.php.
I can't think of a way (which isn't to say it's impossible) of having your .ht stuff respected within a single controller, and then pulling up the usual ht authentication dialog for the user. But I don't know a lot about the inner workings of htaccess authentication - it's been a while since I've set one up, and even then it was a very simple system.
Really, as above, I think you are going to have to write a very basic authentication system within CI - it could be as simple as a single model / single db table.