Jump to content


Photo

How Should I Properly Structure My Website?


Best Answer AyKay47, 03 March 2013 - 08:35 PM

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.

Go to the full post


  • Please log in to reply
3 replies to this topic

#1 BorysSokolov

BorysSokolov

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts
  • LocationBratislava

Posted 03 March 2013 - 06:41 PM

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, 03 March 2013 - 06:41 PM.


#2 Thiago

Thiago

    Newbie

  • New Members
  • Pip
  • 1 posts

Posted 03 March 2013 - 07:24 PM

Hello friend,

 

You can utilize the Friendly urls with option 1 :)

 

And your URL will be so..

mywebsite.com/home

mywebsite.com/contact

 

Read a little about .htaccess and friendly urls, if you want more help, contact me for e-mail...

 

Thank you.



#3 teynon

teynon

    Advanced Member

  • Members
  • PipPipPip
  • 893 posts

Posted 03 March 2013 - 07:29 PM

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?


Support my Kickstarter Project!
http://www.kickstart...7618755/antroid

http://www.thomaseynon.com

Vulnerabilities: http://cwe.mitre.org...x.html#Guidance - MySQL.com hacked with SQL Injection - If it happened to them, it can happen to you.


#4 AyKay47

AyKay47

    Sick!

  • Members
  • PipPipPip
  • 3,287 posts
  • LocationEast Coast, U.S.
  • Age:24

Posted 03 March 2013 - 08:35 PM   Best Answer

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.


Hola!
I'm not going to hold your hand and write the code for you - ain't nobody got time for that!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com