zhangy Posted June 28, 2009 Share Posted June 28, 2009 hi, I am new to this mod_rewrite stuff and am wondering if someone could show me how to change my current URL: http://mysite.com/data.php?id=1 to the following: http://mysite.com/title-of-blog-entry/ Thanks, Link to comment https://forums.phpfreaks.com/topic/163954-first-time-using-rewriterules/ Share on other sites More sharing options...
Ken2k7 Posted June 28, 2009 Share Posted June 28, 2009 RewriteRule ^title-of-blog-entry\?$ data.php?id=1 ? Link to comment https://forums.phpfreaks.com/topic/163954-first-time-using-rewriterules/#findComment-864940 Share on other sites More sharing options...
zhangy Posted June 28, 2009 Author Share Posted June 28, 2009 so the titles are in a mysql database row called "title". how to insert the content of this table row into that rewrite based upon the id? Link to comment https://forums.phpfreaks.com/topic/163954-first-time-using-rewriterules/#findComment-864941 Share on other sites More sharing options...
zhangy Posted June 28, 2009 Author Share Posted June 28, 2009 oh I guess I first need to pass the title through the url instead of the id using $_GET :-X Link to comment https://forums.phpfreaks.com/topic/163954-first-time-using-rewriterules/#findComment-864943 Share on other sites More sharing options...
zhangy Posted June 28, 2009 Author Share Posted June 28, 2009 OK so now my URL looks like this: http://site.com/data.php?title=The%20beginning%20of%20loss...%20a%20mind%20once%20found%20just%20isn't how do you change the %20 to hyphens? and how to remove other characters like periods apostrophes etc. that don't belong in a url? Link to comment https://forums.phpfreaks.com/topic/163954-first-time-using-rewriterules/#findComment-865079 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.