biggieuk Posted May 5, 2010 Share Posted May 5, 2010 Hi all, I just need clarification on a mod_rewrite issue im having. I currently have links like so: www.website.com/12/blah-blah-blah which are already being re-written from: www.website.com/index.php?id=12 (blah-blah-blah is just random useless text to make it look pretty) Is it possible to remove the 12 part using mod_rewrite or am i going to need some sort of redirect page inbetween? Thanks for your help! Quote Link to comment https://forums.phpfreaks.com/topic/200775-remove-id-from-url-clarification/ Share on other sites More sharing options...
trq Posted May 5, 2010 Share Posted May 5, 2010 Yes its possible but aren't you relying on that information to determine what document is served up? Quote Link to comment https://forums.phpfreaks.com/topic/200775-remove-id-from-url-clarification/#findComment-1053561 Share on other sites More sharing options...
biggieuk Posted May 5, 2010 Author Share Posted May 5, 2010 Sorry for not being clearer. Yes, I still need to use the ID to determine which page contents are to be loaded but I dont want to show it in the URL. Quote Link to comment https://forums.phpfreaks.com/topic/200775-remove-id-from-url-clarification/#findComment-1053635 Share on other sites More sharing options...
cags Posted May 5, 2010 Share Posted May 5, 2010 And without the 12 in the link how is it going to know what link to open? Magic? The only real solution would be to create a permalink field in your database that would be used instead of the id. This would essentially be an id but in the form of a string rather than an id number. Therefore blah-blah-blah, wouldn't just be there to make it pretty it would be the unique ID for the row in the database. Quote Link to comment https://forums.phpfreaks.com/topic/200775-remove-id-from-url-clarification/#findComment-1053648 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.