This programming tutorial will teach you how to build search engine friendly URLs in PHP, which contain keywords and use HTML extensions. We are going to use the htaccess file and mod_rewrite module running on an Apache server.
More PHP Resource
Creating search engine friendly URLs in PHP is easier than some may think. First you need to make sure your server can read .htaccess files, and that you have the mod_rewrite Apache module installed. The majority of webhosts have mod_rewrite active and are ready for rewriting URLs.
If you're running PHP on a Windows server (IIS), I'm afraid this method of rewriting URLs will not work for you.
Rewriting URLs with a query string
Most of the time you'll probably want to create URLs based on pages returned from a (MySQL) database. Say you have the following pages:
More resources for PHP-friendly URLs:
- URL Rewriting Tool
- SEO URLs with PHP
- PHP alternative to mod_rewrite for SE friendly URLs
- Search Engine-Friendly URLs [PHP & MySQL Tutorials]
- RewriteRule to make URL SEO PHP
http://carlconstantine.ca/2009/05/18/creating-search-engine-friendly-urls-in-php-and-mysql/
http://www.web-design-talk.co.uk/116/seo-friendly-urls-with-mod-rewrite/
http://www.geekpedia.com/tutorial166_Creating-friendly-URLs-with-mod-rewrite.html
http://htmlblog.net/seo-friendly-url-in-php/
http://www.phpriot.com/articles/search-engine-urls/6 bast url
Further resources
- Apache 2.0 URL rewriting guide
- Apache ForceType directive
- Apache ErrorDocument directive
Other Options
- Download a PDF version of this article
- View or post comments for this article
- Browse similar articles by tag: PHP, SEO
3 Comments
SEO friendly URLs are imperative yet key technique. It acts as SEO advantage as well as enable user know what a URL indicates.
ReplyDeleteThanks for sharing great info
website security certificate | ssl certificate price | Dedicated Servers in India | cheap dedicated hosting india
Superbly written article, if only all bloggers offered the same content as you, the internet would be a far better place..
ReplyDeleteSeo Agency Newyork
I'm glad I found this web site, I couldn't find any knowledge on this matter prior to.Also operate a site and if you are ever interested in doing some visitor writing for me if possible feel free to let me know, im always look for people to check out my web site.
ReplyDeletewordpress website security