Code for making a page title part of the URL

I currently use this format:

But I keep reading that search engines prefer to have article names in the URL like this:

Don’t URLs this long make it difficult for people to tweet the address to a friend? If this is really the path I should take, can someone point me to a good tutorial or something that will help me convert the article title into an appropriate add-on to the URL? For example, I’m guessing that words like a, of, the, it, etc. may want to be filtered out? And word’s that have an apostrophe will need to be accounted for too. Is there a PHP function that does this?

Thank you!

Contrary to popular belief, using these types of URL’s does not aid search engines in any way, Google won’t care how you structure your urls as long as they include keywords (at least that’s what I have been led to believe), However, pretty urls are much more user friendly, because of their predictability, and they are really easy to implement too! For your other questions, when i implimented them on my blog i restructured the way I get to certain article from using ids to using a special url sequence that i derived from the title of the blog, i replaced spaces with hyphens and replaced apostrophes and other potentially harmful charechters as well using str_replace(). Here is a good tutorial on how to start using pretty urls: http://net.tutsplus.com/tutorials/other/using-htaccess-files-for-pretty-urls/

Hope that helps!

If you are really worried about tweet length then you could have a place on your page that has a ‘tiny URL’ version of the page URL displayed so that people could copy and paste the small URL and not adversely affect their tweet character count.

If you are using Apache or IIS as your web server you could always use mod-rewrite to change http://www.oil-testimonials.com/essential-oils/7488 to http://www.oil-testimonials.com/esse…for-performers. You can google mod_rewrite or see [URL=“http://datakoncepts.com/seo”]dklynn’s tutorial on it.

Steve