Welcome Guest, Not a member yet? Register   Sign In
Hi from a begginer user of CI
#8

[eluser]Daniel Moore[/eluser]
[quote author="Zorancho" date="1240171196"]The only problem is that i have this kind of file structure: website folder is in www folder of the wamp directory and inside the website folder i have: system, images, css, js folders and .htaccess file from above.
When i go to an url in my address bar: http://localhost:8888/website/css i can get to the css file or to the images folder and js folder as well. How i can prevent direct access to those folders?
Zoran[/quote]

Ok, the most secure method, and the simplest, is as follows. For each folder you wish to deny access to, place an .htaccess file in that folder with the following line:
Code:
deny from all

That's all there is to it.

I know a lot of people will get you to jump through hoops to move everything outside the web root, but that isn't possible on many hosted server accounts. The method I have given you makes it as safe as if it were outside the web root, and will be a solution when you install on servers that do not give you access to place files or directories outside the web root.

Happy coding!


Messages In This Thread
Hi from a begginer user of CI - by El Forum - 04-19-2009, 08:59 AM
Hi from a begginer user of CI - by El Forum - 04-19-2009, 09:42 AM
Hi from a begginer user of CI - by El Forum - 04-19-2009, 04:15 PM
Hi from a begginer user of CI - by El Forum - 04-19-2009, 07:56 PM
Hi from a begginer user of CI - by El Forum - 04-19-2009, 08:01 PM
Hi from a begginer user of CI - by El Forum - 04-20-2009, 02:25 AM
Hi from a begginer user of CI - by El Forum - 04-20-2009, 08:11 AM
Hi from a begginer user of CI - by El Forum - 04-20-2009, 11:05 AM
Hi from a begginer user of CI - by El Forum - 04-20-2009, 11:46 AM
Hi from a begginer user of CI - by El Forum - 04-20-2009, 11:59 AM



Theme © iAndrew 2016 - Forum software by © MyBB