ukscotth Posted July 18, 2010 Share Posted July 18, 2010 Hi, Ive been building a few sites lately and they get very busy very fast and it puts alot of strain on my server due to excesive sql queries. Ive noticed alot of sites use folders for things that i would use index.php?id= for. e.g i have a social network and peoples profiles are shown like mysite.com/index.php?user=bob. Would it be best to have the profiles as mysite.com/bob/ instead ? I was thinking this would mean less database queries and would be better for seo. Am i right in thinking this or have i got it wrong ? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/208122-create-a-folder-and-file-or-use-id/ Share on other sites More sharing options...
trq Posted July 18, 2010 Share Posted July 18, 2010 The code underneath is the same for clean urls, vs the style that you are currently using. The directories don't actually exist, its a trick done with Apache's mod_rewrite. Quote Link to comment https://forums.phpfreaks.com/topic/208122-create-a-folder-and-file-or-use-id/#findComment-1087911 Share on other sites More sharing options...
ukscotth Posted July 18, 2010 Author Share Posted July 18, 2010 oh right ok thanks, is there any other point to it apart from making the url's look tidier ? Quote Link to comment https://forums.phpfreaks.com/topic/208122-create-a-folder-and-file-or-use-id/#findComment-1087913 Share on other sites More sharing options...
premiso Posted July 19, 2010 Share Posted July 19, 2010 oh right ok thanks, is there any other point to it apart from making the url's look tidier ? No not really. The main reason people do it is for "SEO" reasons, which only goes so far and for profile information, it really will not matter too much. Now for blog posts it is good to create these "clean" / slug URLs from the title, but again not exactly necessary. Quote Link to comment https://forums.phpfreaks.com/topic/208122-create-a-folder-and-file-or-use-id/#findComment-1087924 Share on other sites More sharing options...
PFMaBiSmAd Posted July 19, 2010 Share Posted July 19, 2010 ...excessive sql queries Define excessive? What kind of problems do you have with the site? Have you already optimized the queries you do have? Unless you identify what is causing a problem, you cannot fix it because when you randomly attempt things, they won't address the root cause of the problem. Quote Link to comment https://forums.phpfreaks.com/topic/208122-create-a-folder-and-file-or-use-id/#findComment-1087925 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.