CodeIgniter: SEO Friendly URLs

I am developing an e-commerce site using CodeIgniter. What are the general strategies used to create friendly URLs for SEO?

Say I have a product with id of 123 and product name 32 in Sony TV . I just do the following:

 http://www.domain.com/product/123/32-in-sony-tv/ 

Meaning, I have 2 segments of URI. The first is used to identify the actual product. The second is simply ignored by the application (although internal links, sitemap.xml, etc. Everyone refers to the product in its SEO-friendly form).

Suggestions?

+6
seo codeigniter codeigniter-url
source share
6 answers

I have solved this specific problem differently with Routing URI Routing and with great success.

When creating a new product, you must save the decrypted name (32-in-sony-tv) in a unique indexed field in the product table of your database. The function that creates the portable name should check if that name is used and add “-1”, “- 2”, “-3” and so on until it finds a string that is not used (for example: 32-in- sony -tv-4).

In your application/config/routes.php add:

 $route['product/(:any)'] = "catalog/lookup_by_hyphenated_name/$1"; 

This will lead to redirecting requests for http://www.domain.com/product/32-in-sony-tv to http://www.domain.com/catalog/lookup_by_hyphenated_name/32-in-sony-tv behind the scenes and will allow you to use all kinds of flexibility.

+11
source share

It all depends on how much you want your URLs to look and how you define "clean." If you got rid of the product_id URI segment and made your url like this:

 http://www.domain.com/product/32-in-sony-tv/ 

The main difference is that you have to make sure that all your products have unique aliases that never change. This means that if you have another 32-inch Sony TV, you will have to change it a bit. This limits you, of course, to the fact that you cannot change your nickname in the future if you decide to do so.

Try also to keep in mind that it is very, very, very unlikely that any of these factors will affect your search engine ranking. Basically, you should focus on how people perceive your URLs and any pitfalls you may encounter two or three years after changing the name of the product alias.

Due to the unpredictability of what your customers (or you) might want to do with these aliases, I personally stuck with the type of URL that you said you are using. Better to work with an ID based system, I think.

+3
source share

Hi Codeigniter allows you to use this type of function using the URL helper

please follow this link you can find out the code for the titleignign url

http://ellislab.com/codeigniter%20/user-guide/helpers/url_helper.html

 $title = "What wrong with CSS?"; $url_title = url_title($title); // Produces: Whats-wrong-with-CSS 
+3
source share

Since amazon.com does the same thing that you are considering, I would say that you are in a good company.

0
source share

I am developing a web application using CodeIgniter, and although this is not e-commerce, I also need the best URLs and, as such, have taken the same route as you, as Robert, Amazon and other major online retailers say. so I think if this is enough for them, it is good enough for me :)

0
source share

I do this with all my CI applications, and I would go with what NexusRex said. This is the best route, and yes, if the keywords in your URL affect the ranking of your search engine.

0
source share

All Articles