Simplistic Technologies > Support > Articles > Seo > SEO Friendly URLs

Search Engine Optimization Articles

Creating Search Engine Friendly URLs

April 21, 2009

I am sure we have all seen Web addresses with a ?something (query string). Not only are those types of addresses unpleasing, but might also be unliked by some search engines. Thankfully, there is a way to turn them into something more search engine friendly, as well as improving the look of the address in a Web browser.

For this, we will take a look at Enlightenment Ministry, which offers visitors 3 versions of the Bible. Let us take a look at an example using the American Standard Version (ASV).

Both links result in the same basic information, although the first link provides the information without the page items, for those linking to the Web site from their own. This addressing scheme was in fact the way even visitors to the Enlightenment Ministry Web site used this resource. However, thanks to using a .htaccess, this results in the second address instead.

HTACCESS MAGIC

We need to provide htaccess with a method to rewrite the provided address (second link) to the necessary address (first link), while not changing the address bar. In this example, the necessary address performs a database lookup. So, we use the following:

RewriteRule ^resources/bible/asv/$ /resources/bible/bible.php?ver=asv [QSA]

We start with stating it is a RewriteRule. The ^ is the start of line anchor and the $ is the end of line anchor. The first part is the address being used, the second section is the "behind the scenes" or necessary address. The [QSA] allows for passing through the query string (?ver=asv). Similiar RewriteRules were added to handle the books (such as Genesis) and chapters.

Remember to make sure the rewrite engine is turned on by adding to the top of your htaccess file the following line:

RewriteEngine on

Now let's all make sure our links are search engine friendly and try to get higher rankings for our Web sites.