Welcome Guest, Not a member yet? Register   Sign In
search engine friendly urls
#1

[eluser]face1m[/eluser]
What is the best way to make my site url's search engine friendly? Currently, I have my controller in the route[default controller] = mycontroller in the route.php file. Thanks.

rick mcelderrry
#2

[eluser]theprodigy[/eluser]
One of the things I do is, I try to stay away from url's like
Code:
http://www.domain.tld/my_controller/products/1234

I overcome url's like that by having a link_name column in my database set as unique (to avoid duplicate entries), and run my searches based on that column rather then the id.

This allows me to create url's like
Code:
http://www.domain.tld/my_controller/products/my_red_stapler

Most search engines prefer words over id's when dealing with url's, especially when the word is relevant to the content being displayed.

There are several other things you can do, but this is one that I have gotten in the habit of always doing.
#3

[eluser]face1m[/eluser]
Thanks! That was a very useful post.

rick mcelderry
#4

[eluser]123wesweat[/eluser]
Quote:This allows me to create url's like
Code:
http://www.domain.tld/my_controller/products/my_red_stapler

is there a difference SEO-wise when using

Code:
http://www.domain.tld/my_controller/products/my-red-stapler

hence _ vs -
#5

[eluser]theprodigy[/eluser]
I've read somewhere else on this forum that search engines actually prefer hyphens over underscores (so in essence, your way would be better).
Although, I have not done any research on it myself, so I can't actually verify if there is a difference or not.
#6

[eluser]Peng Kong[/eluser]
i also think hyphens are preferred over underscores but i don't think anyone can be 100% sure that its truly better for SEO. However URL with underscores are hard if they are underlined when being displayed.

Quote:http://www.domain.tld/car_controller/bra...volkswagen

that looks ugly right?
so in your route file you can do...

Code:
$route['cars/brand/(:any)'] = "car_controller/brand_function";

which gives you...

Quote:http://www.domain.tld/car/brand/volkswagen




Theme © iAndrew 2016 - Forum software by © MyBB