computermax2328 Posted September 17, 2012 Share Posted September 17, 2012 Hello All, I have been trying to grasp this concept for a while, but no one has been able to explain it to me. I am currently developing a website and part of that website is a home brewed blog system. The blog build has been pretty fun, but the concept I have been trying to grasp is when it comes to blog posts generated by php, hmtl and xml. One be ball of coding fun. The way I have my blog built is on the backend the admin fills in all the information, title, author, blog entry, etc. Then that information is store in a database via a form POST script. On the blog front page the visitor will click the story link and all the information is pulled from the database based on an idea number automatically given to that blog post when it is posted to the database from the backend. Now the idea is how do I make those articles search engine friendly. I talked to some SEO experts and they told me that search engine crawlers prefer html, but I cant create all those pages without php. My idea is to ask is there anyway to create html pages with php and store them in a folder? Is there another method I am missing?? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/268457-grasping-a-concept/ Share on other sites More sharing options...
trq Posted September 17, 2012 Share Posted September 17, 2012 The part you are likely missing is a mod for apache called mod_rewrite. This allows your server to process requests for non existent pages as though they actually existed. eg; A url like: /some-article.html can be processed by your blog.php file and you can have the "some-article" part passed in as a parameter allowing you to do a database lookup by article title. A simple rule for this might look something like: RewriteRule ^([^.]+)\.html$ blog.php?article=$1 Then, in blog.php you will have $_GET['article'] which will contain the string "some-article" (given the above example). Quote Link to comment https://forums.phpfreaks.com/topic/268457-grasping-a-concept/#findComment-1378526 Share on other sites More sharing options...
computermax2328 Posted September 17, 2012 Author Share Posted September 17, 2012 Right! I have seen this before, but my greatest concern in this conversation is SEO and a site map when it comes to php stored articles in a database. In an xml sitemap it is best if you have each page posted on your sitemap. So, I guess my question is, is there a way to post to a site map everything you create a new story? Quote Link to comment https://forums.phpfreaks.com/topic/268457-grasping-a-concept/#findComment-1378527 Share on other sites More sharing options...
trq Posted September 17, 2012 Share Posted September 17, 2012 Of course there is. Just have your site map generated by php. Quote Link to comment https://forums.phpfreaks.com/topic/268457-grasping-a-concept/#findComment-1378528 Share on other sites More sharing options...
ignace Posted September 17, 2012 Share Posted September 17, 2012 I talked to some SEO experts and they told me that search engine crawlers prefer html, but I cant create all those pages without php. ROFLMAO. PHP is just fine. You send HTML to the browser, so search engines will also read that HTML not your PHP script. Like thorpe mentioned you need mod_rewrite to create rewrite rules so special URL's are re-routed: http://somedomain.top/blog/foo-bar-was-here/ Which is then redirected to your script where you resolve foo-bar-was-here to an actual row in your database and display that information. Quote Link to comment https://forums.phpfreaks.com/topic/268457-grasping-a-concept/#findComment-1378529 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.