Welcome Guest, Not a member yet? Register   Sign In
Which technique usually professional CI use for SEO?
#1

[eluser]webbymonk[/eluser]
I am learning mod-rewrite for beautifying URL, but there is a lot of way,,
Especially CI already provided the segmented URI for easy query.

For example:
Old fashioned URL:
http://www.site.com/index.php?cat=123

CI style
http://www.site.com/cat/123

If I want to achieve http://www.site.com/cat/Event-and-Entertainment

Which technique is the best for this SEO?

1. using Mod-Rewrite to rewrite http://www.site.com/cat/123 to http://www.site.com/cat/Event-and-Entertainment

2. Do query directly not by ID but by category name?
ex: select * from category where category_name = 'Event & Entertainment'
#2

[eluser]ray73864[/eluser]
i have a seperate field in my tables called 'seo_name' and i search on that, then you can use something like url_title() i think it is from the URL helper class to create the seo's and stick them into the table.
#3

[eluser]Developer13[/eluser]
What I would do is store a url_title() value along with the normal category name in your category table, then query based on the category segment of your url (such as events-and-entertainment).
#4

[eluser]Developer13[/eluser]
Crap - sorry ray -- I must've submitted right after you did.
#5

[eluser]ray73864[/eluser]
happens to me all the time D13, the horrors of page refreshing and submitting posts to a forum.
#6

[eluser]webbymonk[/eluser]
Thanks for remind me that URL helper has url_title() function I haven't ever used yet...
Usually the function I used is anchor(), site_url(), base_url()...

I will use the technique as you guys told me...Thanks for your helps....


I will treat you guys if you come to Indonesia...
#7

[eluser]gullah[/eluser]
I don't see why url_title() is necessary at all?

EDIT: ok I see. I started looking into this and I develop on Firefox and it doesn't put the annoying in the spaces which is why you would want to use the url_title()
#8

[eluser]Developer13[/eluser]
[quote author="drewtown" date="1228300314"]I don't see why url_title() is necessary at all?[/quote]

The function would take "Events & Entertainment" and transform it to "events-entertainment", which would be a "safe" url segment. Storing the url_title() would enable an easy query against a database based on that segment.
#9

[eluser]JoostV[/eluser]
url_title() strips unwanted characters from your uri and converts it to lower case. It will save you from creating a uri that will throw a CI 'disallowed characters in uri' error.

Also, it's good to use a generic uri filter. This means there will be no surpises when you for instance have tp compare two uris, or use a segment value in your script.
#10

[eluser]gullah[/eluser]
oh I understand now, stupid IE and not just spaces and showing stupid grumble grumble...
* El Forum goes off to do a lot more work.




Theme © iAndrew 2016 - Forum software by © MyBB