Jump to content

How Should I Properly Structure My Website?


BorysSokolov

Recommended Posts

So far, I came up with two main approaches -
 
Option 1: Create an index with an included header and a footer, and require the relevant file/page based on a GET variable.
Option 2: Create a footer and a header file, and include them on every page.
 
The problem is, neither of those methods seem to work for me. With option 1, the specified page gets stored in the address, and makes the URLs look not as "clean" - mywebsite.com/index.php?page1. With option 2, the code quickly becomes disorganized.

 

Advice?

Create a header and footer file and include them on every page.

 

If you create one page that does everything, eventually, that page is going to become a big blob of programming code that you hate to work on. You need to organize your code into pages that fulfill a specific purpose.

 

When you say option 2 makes the code disorganized, then that is quite probably because you are not organizing it well. How is it becoming disorganized?

Option 1 is the more popular solution as it involves much less coding, allows more control over the overall structure of the website, allows for easier debugging etc...

A popular approach to messy URLs is to clean them up using "mod_rewrite" which is something you might want to look into.

Now, we cannot give you an end all answer because it depends on what exactly the websites content is, what logic is implemented both front and back end etc.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.