Jump to content

How Should I Properly Structure My Website?


Go to solution Solved by AyKay47,

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?

Edited by BorysSokolov

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?

  • Solution

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.