Use Descriptive URLs to Bolster Your Search Engine Rankings!
Dynamically generated pages, such as those made by PHP scripts, usually have URLs that aren’t very readable, like “mysite.com/script.php?id=3951&page=2″. The URL doesn’t say anything at all as to what the page is, other than showing that it’s generated by a script. If you want to make your dynamic pages more search engine friendly, rewrite your scripts to use descriptive URLs!
A URL like “mysite.com/blogpost/3951-People-Know-What-This-Is.html” would be a lot better, wouldn’t it? Right off the bat, you know what the page is about. If you’re scrolling through your recent pages, you can find exactly what you’re looking for a lot easier. More importantly though, search engines love URLs like these, so you get a nice rankings boost!
As a PHP programmer, I’m going to detail this technique with PHP, but the same principle applies to whatever serverside scripting language you use.
To start, have the script execute as a file without the extension, instead of with the .php extension (or or .jsp, or whatever extension your language uses). On Apache servers, you can use a ForceType statement in the .htaccess file to make the script execute as application/x-httpd-php. This tells Apache to run the file as a script instead of just spitting out your code.
Right now, your script should work properly as “mysite.com/script?id=3951&page=2″. It’s no longer readily apparent which language your site uses, but you can still tell that it’s a dynamic page. Let’s fix that next, by using PHP’s explode function to break up the argument list. Using this, the arguments to your script will look like folders on your server instead of parameters to a script:
$args = explode(“/”,$_SERVER['PHP_SELF']);
Now, if you were to access “mysite.com/script/3951/2″, $args would become an array with “3951″ and “2″. You can replace the slash with a hyphen to separate arguments without making them look like directory entries, or use a second explode statement to break down some of the arguments in a different way.
Finally, write some code that converts the title of the content (be it the blog post name, forum topic, etc.) into an argument, substituting dashes for spaces. Some people use underscores instead of dashes, but the search engines don’t see underscored words as separate terms, so you end up with the search engine thinking “This_Is_My_Post” is one big word.
Add a pinch of code at the top of the script to make ensure that the URL matches the one you want it to be (so it redirects thread/4614-wrong-name-1 to thread/4614-This-is-my-posts-name-1), then add .html to the end of it (so it looks like an innocent html file) and you’re good to go!
To prevent stuffing the url with words that don’t really matter, use the string replace functions to remove words such as “I”, “The”, and “And” from the URL.
Most search engines won’t completely index your website if it’s all stuffed into argument lists, so by having URLs that look like normal filenames you both ensure that all of your pages are indexed and increase your search engine optimization. Making your URLs readable by humans is juts an added bonus. Make sure to update the links within your site to reflect your new URLs, so your page doesn’t turn into a smattering of redirects.
Phil runs a web development resource site. Find yourself asking, http://www.the-phil.com/viewtopic/66796-Where-do-I-Buy-Web-Hosting-Find-out-Here.html>Where do I buy web hosting? Read all about it on Phil’s site!Article Source:http://www.articlesbase.com/internet-articles/use-descriptive-urls-to-bolster-your-search-engine-rankings-803312.html
Related articles by Zemanta
- Passing variables using in the URL (ghacks.net)
- South Florida Website Design Company Blogging for New Customers (blogduck.com)
- SEO and Keyword Density (wealthyways4you.com)
- Web Design and Programming of Development (articlesbase.com)
- Important Aspects of Web Hosting Service (articlesbase.com)
- Tips for Good Website Design (articlesbase.com)
- SkyBlueCanvas Announces Official Stable Release of Version 1.1 (themactrack.com)
- Improve SEO with Google’s New Canonical Element (sitepoint.com)
- Magnetic Enjoys Continued Growth Despite Tough Economic Times (seomashup.blogspot.com)
- Saving Money is as Good as Making Money (mfinch.ca)
Share this:
Read also:
- Market Research
- Blogging Business - Your Gateway to Easy Money
- Blog Marketing Tips, Tools and Tactics Program
- Some Tips to Make Money Blogging
- Top 10 blogging tips
- Blog Marketing Part One
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=6bdf9acb-c8d3-4ec5-b117-4c5b069e3cdf)
April 16th, 2010 at 2:03 am
Post trackbacks and comments to remote blogs automatically with Trackback Submitter! This tool will submit your comments to millions of blogs automatically. Trackback Submitter – the most powerful tool on the planet to submit trackbacks automatically!