friendly url |
[eluser]Thiago Leao[/eluser]
Hi guys, I am wanting to use friendly url on my site, but I have some doubts!!!! On my site I have the following link: http://www.mysite.com.br/News/see News/7988e26df3862a959ce5e85703ff72fd Class News Method seeNews Id 7988e26df3862a959ce5e85703ff72fd In place of the ID, I would like to pass the title of the news. Another thing I want: http://www.mysite.com.br/category/index/...58b9f758fb this link is the User, wanted to change www.mysite.com.br/login thanks
[eluser]rana[/eluser]
use title. no problem. but in that case, in database, 'title' field should be marked as 'unique' to avoid duplicate entry with same title. http://www.mysite.com.br/News/seeNews/{$titile} Now in your "seeNews" function, you will need to to compare/retrieve data with checking against the 'title' field in db instead of 'id' field. Please explain details about your second inquiry..
[eluser]Thiago Leao[/eluser]
Hana Hi, thanks for your reply! But that will not solve my problems. I need to use FRIENDLY URL! thanks!
[eluser]rana[/eluser]
I think, I gave you the exactly that solution. You mentioned you wanted the title on url instead of long ugly id. What I suggested will solve it very well. otherwise, can you please show an example how you want it?
[eluser]Otemu[/eluser]
Hi Thiago, rana has already given you the solution to this problem but maybe you don't quite understand. What you need to do is something like this Code: <?php Check out the guide here for more info
[eluser]CroNiX[/eluser]
I'm not sure what the difference would be between passing the unique article ID, or passing the unique title. It's the same thing. Instead of searching the db for the unique ID, you'd just search for the title instead. So maybe you can be more clear on what the problem is?
[eluser]bluelomo[/eluser]
Your news id is a GUID? why don't give a friendly domain each news? |
Welcome Guest, Not a member yet? Register Sign In |