• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Best way to protect admin-directory

#1
[eluser]Unknown[/eluser]
Hi,

I've been using codeigniter for some weeks now, and I must say it's a really neat framework. I developed the entire frontend of my website in just about a week of time, and now it's time to dive into the backend. Yay. Before, I've always used htaccess to protect a certain admin folder, but now I don't know how to accomplish that with CI.

I've placed an admin-folder inside the controllers directory, and can easily access its controllers and fucntions. But where do i put the htaccess/htpasswd file so it applies on the admin folder?

The thing is I want to be able to access all my previously written models and libraries which are to be shared by both the frontend and the backend. Perhaps it's easier to just use a session login? But I like htaccess protection, it's so convenient... Or are there any other solutions out there?

Thanks
//

#2
[eluser]Armchair Samurai[/eluser]
You can't use .htaccess in this case - you'll need to either create your own auth system or use one of the libraries submitted by members. Try searching in the wiki.

#3
[eluser]Future Webs[/eluser]
you can make an empty admin folder in the root dir of your site and put the htaccess / password there

I thought about this yesterday and tried it and it works fine for a quick and simple way to protect a dir

#4
[eluser]Future Webs[/eluser]
scratch that, it dont work :-(

#5
[eluser]gunter[/eluser]
why doesn´t it work to put the index.php file into another folder - with the correct path variables to the rest of the installation... so you can use the htaccess file... -

#6
[eluser]bd3521[/eluser]
gunter .. that would work just update index.php accordingly with the correct paths


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.