![]() |
htaccess / admin area - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: htaccess / admin area (/showthread.php?tid=26548) |
htaccess / admin area - El Forum - 01-16-2010 [eluser]Daniel_E9[/eluser] I have a site built on codeigniter using the below htaccess file which removes the need for index.php: Code: RewriteEngine On I have an admin section on a controller/view called admin. When I go to domain,com/admin I want it to ask for a password. Using the below htaccess in the admin folder doesn't work though - any ideas? Code: AuthType Basic Thanks htaccess / admin area - El Forum - 01-18-2010 [eluser]Unknown[/eluser] Hi Daniel_E9, I think that you have to create a physical folder on you server at the home directory :www/admin/ and copy the CI index.php to this folder and change the the variables : $system_folder="../system"; $application_folder = "../application"; then you have to create another .htaccess file inside this folder :www/admin/ and put the right (rewriteRules) to this file finally you have to protect this folder using your hosting tool : Cpanel : Password protected directories . Godaddy : check you folder then choose permission. the tool will create every thing for you and will place the .htaccess on the folder then you can alter the (RewriteRules) and you are ready to go.. htaccess / admin area - El Forum - 06-09-2011 [eluser]Mat Marlow[/eluser] Hi, I managed to get the above method to work WITHOUT the authentication, but when I add the Auth rules, I get a password input and then a 500 error when I get through. If I comment the Auth rules again, it works fine. So I have a directory called /admin which has the CI index file with the systems and application directories re-pointed as per the above post, and the following .htaccess file. <b>/admin/.htaccess</b> Code: AuthName "Restricted Area" Any idea what's stopping these rules from working? They work perfectly on their own, but not together! I've tried moving the Auth lines to the bottom, but no luck. Thanks in advance, Mat htaccess / admin area - El Forum - 06-10-2011 [eluser]InsiteFX[/eluser] htpasswd - Manage user files for basic authentication InsiteFX htaccess / admin area - El Forum - 06-11-2011 [eluser]Mat Marlow[/eluser] That doesn't answer my question. I already have a working htaccess file. Is there something I'm missing??? htaccess / admin area - El Forum - 06-11-2011 [eluser]InsiteFX[/eluser] because you need the full path! InsiteFX |