Welcome Guest, Not a member yet? Register   Sign In
Configure URL for sake of SEO
#2

(This post was last modified: 09-06-2019, 07:13 AM by PaulD.)

This is all relatively easy to achieve so you are unlikely to find any code samples to do this.

When you get your articles from the database ensure you also retrieve the article slug. When you are listing your article links in your view or menu view, make sure you construct your article links with your base_url/controller/method/slug format.

Your controller method will then look for the correct article based on the slug and retrieve the article details.

If you are conversant with retrieving data from the database, this should be no trouble at all. It is not really possible to post any example code as it is all too dependent on your site structure, db structure etc.

Best wishes,

Paul

EDIT: I take that back, slugs are used in the tutorial in the docs which should serve as a good starting point. https://codeigniter.com/user_guide/tutor...ction.html
Reply


Messages In This Thread
Configure URL for sake of SEO - by cybersalih - 09-06-2019, 06:44 AM
RE: Configure URL for sake of SEO - by PaulD - 09-06-2019, 07:09 AM
RE: Configure URL for sake of SEO - by demyr - 09-06-2019, 11:47 AM



Theme © iAndrew 2016 - Forum software by © MyBB