Which technique usually professional CI use for SEO? |
[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'
[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.
[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).
[eluser]Developer13[/eluser]
Crap - sorry ray -- I must've submitted right after you did.
[eluser]ray73864[/eluser]
happens to me all the time D13, the horrors of page refreshing and submitting posts to a forum.
[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...
[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()
[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.
[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.
[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. |
Welcome Guest, Not a member yet? Register Sign In |