cindreta Posted October 6, 2009 Share Posted October 6, 2009 Hi, please just don't tell me to use htaccess only with sef urls, i have been trying to solve this myself. Basicly my question is i have a cms and i wanna make seo friendly urls from this: site.com.news.php?id=55 to per say site.com/news/some-news-title if i got the idea right i would have to generate a sef url for every article and store it to mysql, and then do i have to change my queries(since i want titles and not id's in url) to be look something like this: select stuffhere from table where sefurl=$_GET[sefurl] is this how it works? i mean is this going to be slower then getting it by id? is there a way to still have id's in a mysql query an have titles in sef urls?? please i really need somebody to explain or show, its driving me crazy Link to comment https://forums.phpfreaks.com/topic/176758-dynamic-sef-urls-phpmysql-help/ Share on other sites More sharing options...
cags Posted October 6, 2009 Share Posted October 6, 2009 There are several different ways of doing it. Alot of sites that use 'pretty-urls' don't actually use the title part, they ignore it, but have the id stored in the URL too. What exactly do you mean by... Hi, please just don't tell me to use htaccess only with sef urls, To my knowledge you can't do this without using .htaccess files (at least on an Apache server, no doubt IIS and other hosting options have differen't methods). Link to comment https://forums.phpfreaks.com/topic/176758-dynamic-sef-urls-phpmysql-help/#findComment-931949 Share on other sites More sharing options...
cindreta Posted October 6, 2009 Author Share Posted October 6, 2009 by that i ment i know i have to at the end go and make an htaccess file but i did not manage to do what i described in the post with htaccess only... well please tell me how it's done, or show me an example since you already know, i am very interested in keeping my query id's and still haveing the title in the url. can you show examples, code, web site tutorials or something? (ps. i searched google and there are mainly htaccess tutorials only? thank you Link to comment https://forums.phpfreaks.com/topic/176758-dynamic-sef-urls-phpmysql-help/#findComment-931957 Share on other sites More sharing options...
cags Posted October 7, 2009 Share Posted October 7, 2009 Here's a basic tutorial I wrote on the topic. Not neccessarily the best way to approach the problem, just the way I choose to do it at the time. http://phpacademy.info/forum/viewtopic.php?f=31&t=1059 Link to comment https://forums.phpfreaks.com/topic/176758-dynamic-sef-urls-phpmysql-help/#findComment-932030 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.