Ho to protect the project files or folder in codeigniter ? |
[eluser]ludo31[/eluser]
Hello ; I begin and I suppose that I finish my project , so I would like to protect it in order someone can't change or can't access to it . How to do that . I hear : .htaccess et .htpasswd but I don't know how to do and how it works ?? I find in CI project for example : my folder's name of my project : is Monsite and inside : there are : - index.php - system - js - pictures - css - application and inside application there are a lot of folder : and .htaccess file and index.html so can you tell me please what to do ?? I d like to protect my project as possible !! thanks
[eluser]Stefan Hueg[/eluser]
I read through your post two times but could not understand what you want. Could you explain it a bit further?
[eluser]InsiteFX[/eluser]
If you really want to protect them then move the ssystem and application folders outside of your root! Edit index.php and set the correct paths to your system and application folders.
[eluser]Aken[/eluser]
.htaccess files inside the application and system folders already prevent HTTP requests to those folders. But if you want better protection, do what InsiteFX said.
[eluser]ludo31[/eluser]
thanks but please can you explain more because I begin with that , if I understand I put system and application outside the principal project Monsite . after I edit index.php at the same directory than 2 folders (system and application ) and after we must set the correct paths to system and application folder / How to do that ????
[eluser]ojcarga[/eluser]
What @InsiteFX & @Aken recommend you is to move the "application" and "system" folders one level top of your server's root. Example: -- public_html |- system |- application |- index.php |- css |- js You have this structure right now, but you sould move the "application" and "system" folders -- system -- application -- public_html |- index.php |- css |- js and then change the variables (they are in the index.php file which is in the root) Code: $system_path = 'system'; Also change Code: define('ENVIRONMENT', 'development'); http://ellislab.com/forums/viewthread/125687/
[eluser]ludo31[/eluser]
[quote author="ojcarga" date="1335803853"]What @InsiteFX & @Aken recommend you is to move the "application" and "system" folders one level top of your server's root. Example: -- public_html |- system |- application |- index.php |- css |- js You have this structure right now, but you sould move the "application" and "system" folders -- system -- application -- public_html |- index.php |- css |- js and then change the variables (they are in the index.php file which is in the root) Code: $system_path = 'system'; Also change Code: define('ENVIRONMENT', 'development'); http://ellislab.com/forums/viewthread/125687/ [/quote] I follow what you recommand but I have message error : Code: Your system folder path does not appear to be set correctly. Please open the following file and correct this: index.php I put application and sytem outside so I create anothe folder : Principalfolder so : it seems like this : Code: -Principalfolder in index.php I write: Code: define('ENVIRONMENT', 'production'); and in .htaccess I keep this code : Code: <IfModule mod_rewrite.c> that's it
[eluser]InsiteFX[/eluser]
Code: $system_path = '../system';
[eluser]CroNiX[/eluser]
That's an outdated htaccess. The application and system directories have their own htaccess preventing access, so those rules dealing with them are unnecessary and from an older version of CI.
[eluser]ojcarga[/eluser]
[quote author="InsiteFX" date="1335812703"] Code: $system_path = '../system'; Yes, as @InsiteFX said should works. But, the idea about changing the path of those folders is to place them in a place where they become unreachable, that means you should place them out of the server root. That is why I mentioned public_html and they should be in the parent folder of that "server root" (the server root in most cases is public_html). |
Welcome Guest, Not a member yet? Register Sign In |