Edmonds Commerce Logo
  • home
    • blog
  • ecommerce
    • product catalogue
    • order processing
    • customer services
    • stock control
    • human resources
    • management information
  • development
    • oscommerce
    • php
    • mysql
    • open source
    • performance tuning
  • design
  • marketing
  • contact us
    • pricing

Edmonds Commerce Blog

Freelance PHP Ecommerce and SEO Developer in the UK

Latest Posts

Magento Most Popular Extensions
Google Chrome for Linux Beta
Firefox Address Bar Lag + Solution
Custom Buttons for Firefox

Most Popular Posts

Magento Developer UK Freelance osCommerce UK Magento Training CRE Loaded UK

Apache, mod_rewrite and SEO

March 4th, 2008
Read More apache, mod_rewrite, search engine optimisation

Dynamic database driven web sites tend to use various GET variables to define which content to display on that particular page. This is perfectly normal and reasonable. However it does make things a little confusing for search engine spiders as not every GET variable pertains to alternative content. Often GET is used for session, or maybe referrer tracking - or pretty much any piece of information which your web site may use.

This can mean that your product page about fluffy banana shaped teddy bears has the address

PLAIN TEXT
CODE:
  1. mysite.com/index.php?cat=123&product=333&breadcrumb=123_43_2&session_id=89o7324kjhlef8y234h

Not only does this make life difficult for search engine spiders, but its not exactly the most memorable url for your visitors either.

There is a solution and its called mod_rewrite.

Apache is part of the LAMP stack which is one of the most popular software and operating system combinations used to power web servers. Mod_rewrite is a particular plugin for Apache which allows you to create rules which will rewrite urls when they meet specific criteria.

The only really tricky part about setting up rewrite rules is that by neccessity they rely on regular expressions. Regular expressions can seem like a dark art at first, and often even for a seasoned coder familiar with a bit of regex, decoding someone elses expression can take a bit of brain power to say the least!

However there is no real reason to worry as all you really need to do is to learn how to achieve what you want. You do not need to learn the ins and outs of every particular regex function or operator.

For example take this

PLAIN TEXT
CODE:
  1. RewriteEngine On
  2.  
  3. RewriteRule ^(.*)\.p(.*).html$ product.php?products_id=$2&%{QUERY_STRING} [L]

This rewrite rule will take a url in the form of:
mysite.com/whatever-you-want-here.p.[products_id].html

And automatically convert it so that to your web system it is the url:
mysite.com/product.php?products_id=[products_id]

All you need to do now is devise a nice way of dynamically generating all of those nice keyword rich urls for your product pages and you are in business.

If you want any help enabling the power of mod_rewrite to give your web site properly search engine friendly URLS, get in touch today.

Related Blogs
http://www.crazyleafdesign.com/blog/check-if-mod_rewrite-is-activated-on-your-server/
http://www.jtpratt.com/2008/01/22/how-to-fix-htaccess-file-for-mod_rewrite-and-addhandler-on-godaddy-subdomain/
http://pensae.com/2008/01/14/when-mod_rewrite-doesnt-work/
http://www.logon2.com.au/blog/archive/web-design/php-apache-mod-rewrite-tutorial/
http://blogs.ittoolbox.com/c/codesharp/archives/when-bugs-become-features-22068
http://geniustechblog.com/htaccess-mod_rewrite-tutorials-developer-tools/
http://jeremyhermanns.org/2006/09/30/learning-to-use-mod_rewrite/

Possibly Relevant Posts:

  • no matches

Feed | Respond | Trackback

Leave a Reply

  • RSS Feed
  • Categories

    • adwords
    • apache
    • barcode
    • business
    • creloaded
    • css
    • curl
    • customer services
    • debugging
    • drupal
    • eclipse
    • ecommerce
    • edmondscommerce
    • email
    • excel
    • firefox
    • flash
    • gd
    • git
    • graphs
    • hosting
    • icecat
    • internet news
    • javascript
    • jquery
    • link building
    • linux
    • mac
    • magento
    • management
    • misc
    • mod_rewrite
    • mysql
    • netbeans
    • open suse
    • oscommerce
    • php
    • plesk
    • portfolio
    • product catalogue
    • product feed
    • programming
    • regular expressions
    • ria
    • scraping
    • search engine optimisation
    • security
    • seo
    • spidering
    • symfony
    • twitter
    • ubuntu
    • Uncategorized
    • usability
    • vps
    • web design
    • web development
    • Windows
    • xampp
    • zend framework
    • zip
  • Archives

    • February 2010
    • January 2010
    • December 2009
    • November 2009
    • October 2009
    • September 2009
    • August 2009
    • July 2009
    • June 2009
    • May 2009
    • April 2009
    • March 2009
    • February 2009
    • January 2009
    • December 2008
    • November 2008
    • October 2008
    • September 2008
    • August 2008
    • July 2008
    • June 2008
    • May 2008
    • April 2008
    • March 2008
    • February 2008
  • Tags

    bulk course cre loaded creloaded css custom developer development directories drupal error find firefox git google hosts file html jaunty javascript leeds links linux magento mysql netbeans oscommerce performance php plesk ppc problem replace search engine optimisation seo server symfony table training ubuntu uk virtualbox web web design xml zend framework
  • Random Posts

    • Plesk + Mod Security
    • Easily Create Colour Schemes
    • BBC Release Their Javascript Library - Glow - Open Source
    • Magento Bulk Cache / Index Update Script
    • Hardware Information in Ubuntu
    • Hot Desking is Go
    • Zend Framework Template Renamer Script
    • Home from PHP UK 2009 in London
    • Magento Line Up Grid View
    • Twitter Bar Firefox Addon
  • Recent Comments

    • admin on Magento Backup Error Filesystem.php on line 234 + Solution
    • admin on Magento Leeds
    • Matthew Dolley on Magento Leeds
    • kash on PHP Email Attachment Function
    • Hussein on PHP Save Images Using cURL
  • Category Specific RSS

    • adwords Feed for all posts filed under adwords
    • apache Feed for all posts filed under apache
    • barcode Feed for all posts filed under barcode
    • business Feed for all posts filed under business
    • creloaded Feed for all posts filed under creloaded
    • css Feed for all posts filed under css
    • curl Feed for all posts filed under curl
    • customer services Feed for all posts filed under customer services
    • debugging Feed for all posts filed under debugging
    • drupal Feed for all posts filed under drupal
    • eclipse Feed for all posts filed under eclipse
    • ecommerce Feed for all posts filed under ecommerce
    • edmondscommerce Feed for all posts filed under edmondscommerce
    • email Feed for all posts filed under email
    • excel Feed for all posts filed under excel
    • firefox Feed for all posts filed under firefox
    • flash Feed for all posts filed under flash
    • gd Feed for all posts filed under gd
    • git Feed for all posts filed under git
    • graphs Feed for all posts filed under graphs
    • hosting Feed for all posts filed under hosting
    • icecat Feed for all posts filed under icecat
    • internet news Feed for all posts filed under internet news
    • javascript Feed for all posts filed under javascript
    • jquery Feed for all posts filed under jquery
    • link building Feed for all posts filed under link building
    • linux Feed for all posts filed under linux
    • mac Feed for all posts filed under mac
    • magento Feed for all posts filed under magento
    • management Feed for all posts filed under management
    • misc Feed for all posts filed under misc
    • mod_rewrite Feed for all posts filed under mod_rewrite
    • mysql Feed for all posts filed under mysql
    • netbeans Feed for all posts filed under netbeans
    • open suse Feed for all posts filed under open suse
    • oscommerce Feed for all posts filed under oscommerce
    • php Feed for all posts filed under php
    • plesk Feed for all posts filed under plesk
    • portfolio Feed for all posts filed under portfolio
    • product catalogue Feed for all posts filed under product catalogue
    • product feed Feed for all posts filed under product feed
    • programming Feed for all posts filed under programming
    • regular expressions Feed for all posts filed under regular expressions
    • ria Feed for all posts filed under ria
    • scraping Feed for all posts filed under scraping
    • search engine optimisation Feed for all posts filed under search engine optimisation
    • security Feed for all posts filed under security
    • seo Feed for all posts filed under seo
    • spidering Feed for all posts filed under spidering
    • symfony Feed for all posts filed under symfony
    • twitter Feed for all posts filed under twitter
    • ubuntu Feed for all posts filed under ubuntu
    • Uncategorized Feed for all posts filed under Uncategorized
    • usability Feed for all posts filed under usability
    • vps Feed for all posts filed under vps
    • web design Feed for all posts filed under web design
    • web development Feed for all posts filed under web development
    • Windows Feed for all posts filed under Windows
    • xampp Feed for all posts filed under xampp
    • zend framework Feed for all posts filed under zend framework
    • zip Feed for all posts filed under zip

Edmonds Commerce related questions? Send us a message or call us on 0844 357 0201.

Freelance PHP Web Design UK Commercial Web Design