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, Quote 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 ? Quote 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? Quote 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 Quote 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? Quote Link to comment https://forums.phpfreaks.com/topic/163954-first-time-using-rewriterules/#findComment-865079 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.