BorysSokolov Posted March 3, 2013 Share Posted March 3, 2013 (edited) 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 March 3, 2013 by BorysSokolov Quote Link to comment https://forums.phpfreaks.com/topic/275195-how-should-i-properly-structure-my-website/ Share on other sites More sharing options...
Thiago Posted March 4, 2013 Share Posted March 4, 2013 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. Quote Link to comment https://forums.phpfreaks.com/topic/275195-how-should-i-properly-structure-my-website/#findComment-1416323 Share on other sites More sharing options...
teynon Posted March 4, 2013 Share Posted March 4, 2013 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? Quote Link to comment https://forums.phpfreaks.com/topic/275195-how-should-i-properly-structure-my-website/#findComment-1416325 Share on other sites More sharing options...
Solution AyKay47 Posted March 4, 2013 Solution Share Posted March 4, 2013 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. Quote Link to comment https://forums.phpfreaks.com/topic/275195-how-should-i-properly-structure-my-website/#findComment-1416337 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.