Web traffic is to a website what water is to a river. There is no point in developing a website that no one will ever find on the web. As developers, we usually focus on the technical aspects of the development and forget about search engine optimization. We love query strings because we can pull data from the database using the id supplied in the URL. Why shouldn’t you love query strings? URLs that contain query strings are play grounds of hackers; it is easy to write a Google dork that finds websites that use query strings and attack them using automated SQL Injection tools. In addition to that, static URLs are rich with keyword compared to *.php?i=23. Visitors are more likely to find your pages if the keywords are part of the URL. Below is the list of 4 things that will make your existing or next CMS, Blog, and website have SEO built in out of the box.
  1. SEO friendly URLs – example.com/seo-friendly-urls is considered a good URL by search engines. It is also safer than example.com?id=23
  2. Don’t use underscores in URLs – as developers, we love saving files with underscores as as product_details. This is not good for search engine optimization purposes. Google will treat this as a single word. It is advisable to use product-details in the URL. You can still save your files with underscores but remind to replace them with dashes in the URL
  3. Description Meta tag – ranking in the top 10 results of search engines is useless if no one clicks on your page URLs. You can increase the click through rate in the search engines by taking advantage of the description Meta tag, what is contained in the description tag is what will be displayed in the search engines. Providing your website with a description tag will let the users write keyword rich information that will improve the click through rate.
  4. XML Sitemap – an XML sitemap will help search engines easily find your pages on your website.  You can write a custom PHP function that generates/updates the XML sitemap when new content is added to the database.
Warning: the diagram below illustrates the side effects of developing websites with search engines in mind. seo_friendly_urls For a practical tutorial on how to generate SEO friendly URLs in PHP, visit the URL below. Feel free to ask questions via the comments section if you are stuck with the practical tutorial or you would like some clarifications.

PHP SEO Friendly URLs Practical Tutorial