Mod Rewrite with 'search friendly keywords' that are not needed for the link to work!

Hi,

I think this site is using a MOD REWRITE:

http://www.jiffymix.com/product.php/12/Corn_Muffin_Mix

However, the only part of the link that is needed is:

www.jiffymix.com/product.php/12

and also I should just point out that if you delete parts of the last bit “Corn_Muffin_Mix” the link still works!

ie.
www.jiffymix.com/product.php/12/Corn_Mu
www.jiffymix.com/product.php/12/Corn_Muffin_M

Am I right in thinking that the text “Corn_Muffin_Mix” is for search engines only? If this is true where can I find out more about this optimisation method. I cannot find any resources online that explain about MOD REWRITES where the link includes text that is in the URL is just for search engines!?!?! How do I do it?

Matthew.

You’re exactly right, the text in the URL is for search engine purposes only. Or actually more to make it easy to read to for people. Search don’t care a whole lot about nice URLs (they do a little though).
A good tutorial on mod_rewrite can be found here: Apache’s mod_rewrite

BTW. The fact that the URL still works if you remove (portions of) the word is pretty bad btw. If somehow two different versions of the URL get linked then search engine might penalize for duplicate content, since the same content can be found on two different URLs.
The idea is that the number 12 in the URL indicates which article actually needs to loaded and what I always do in my applications is make sure the text in URL is correct for the article requested, and if not 301 redirect to the appropriate URL to avoid duplicate content.

So with that idea, if you were to request [noparse]http://www.jiffymix.com/product.php/12/Corn_Muffin_[/noparse] (or indeed any other incorrect variation) you would be 301 redirected to [noparse]http://www.jiffymix.com/product.php/12/Corn_Muffin_Mix[/noparse] :slight_smile: