does anybody knows how i can get nice url`s in CodeIgniter like this: examplepage.com/sites/my-new-project instead of examplepage.com/sites/2
The last segment in the URI can be a title oder an other custom string.
Please help me 😉
Regards,
Peter
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
CI’s URLs are “nice” by default – you choose what they are.
Based on the idea of segments, CI has:
controller/method/paramsSo for instance:
You can then produce links like:
site.com/article/read/my-article-titlemy-article-titlewould be a URL slug stored in your database, which thereadmethod will look up and return the appropriate content.The other way as suggested is routing, but hey, the functionality is built right there so you may as well use it.