Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

website folder layout

Tags:

php

I'm not going to ask what is the best way to ...? since they might be several ways to do it, I just want to know from your experience how to manage folders and files when starting to build a website ? (note: I'm not english native that is why I request here, I can't find right places to be answered).

I've been coding for years but always on my own and I never share about how people structure their website before.

As an information, I'm making a structure file at the root of my website, struct.php that contains the common layouts shared by the many pages in my website.

If the user types http://mywebsite.com/folder/ it requests the index file of the requested folder which just contains the 'struct' file importation, for the other variable parts like the metadatas of webpages, I'm creating a folder named meta which contains a file for any type of data (.title, .description, .keywords) and of course the struct file is fetching the content of these informative file and display them in their appropriate place in the document.

I feel comfortable with that structure cause it's been a long time using it. But I'd really appreciate it if you were giving some advices or some useful links and/or tell me how you manage your own website.

like image 762
vdegenne Avatar asked Oct 11 '11 06:10

vdegenne


1 Answers

This is the my way of structuring the page :

application_name
  - views
  - controllers
  - modules
  - templates
  - config
  bootstrap.php

framework
  // not important

public // this is the DOCUMENT_ROOT
  - assets
      - javascript
      - css
      - images
  - uploads
  index.php
  .htaccess // if apache 
like image 99
tereško Avatar answered Sep 21 '22 14:09

tereško