RLJ Posted April 3, 2011 Share Posted April 3, 2011 Hi all, So I've nearly finished coding my first website. Currently all the files are in the same directory on my harddrive, but I now want to create a proper folder structure that will be secure. I have been reading up on this a lot on various websites, but it seems like most articles on this topic are targetted at developers with much more complicated websites than mine, and it's all a bit over my head. My website is quite simple, it consists of the following: 1) html files and php files that print something to the screen that I want to be accessible to the user by typing in the url in the browser. 2) html and php files that are called upon by 1, they either print something to the screen inside an iframe or not at all - I want these files to be accessible only to 1) and not directly to the user by typing the url 3) image files and includes, etc. (and also 4) a MySQL database, but maybe this doesn't really have anything to do with the website folder structure.) What should my directory structure be and where should I put 1), 2), 3), etc.? Thanks a lot! Quote Link to comment https://forums.phpfreaks.com/topic/232601-php-security-website-directory-structure/ Share on other sites More sharing options...
RLJ Posted April 4, 2011 Author Share Posted April 4, 2011 Anyone? Sorry if this is a noobish question, but I've never done this before! Thanks Quote Link to comment https://forums.phpfreaks.com/topic/232601-php-security-website-directory-structure/#findComment-1196561 Share on other sites More sharing options...
ignace Posted April 4, 2011 Share Posted April 4, 2011 Can you give us an example of your directory layout? If your PHP includes the HTML (template) files, it might be wise to put these into a sub directory and add a .htaccess with a Deny from all rule (PHP will still be able to access the files). Quote Link to comment https://forums.phpfreaks.com/topic/232601-php-security-website-directory-structure/#findComment-1196794 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.