dflow Posted March 23, 2010 Share Posted March 23, 2010 i want to create friendly urls like this example.com/CountryName/CityName my url look like this: example.com/page.php?CountryID=12&CityName=23 so infact change the numeric values to their names is there a different solution than access the httpconf? Quote Link to comment https://forums.phpfreaks.com/topic/196263-mod_rewrite-numeric-parameter-value-to-name/ Share on other sites More sharing options...
dflow Posted March 25, 2010 Author Share Posted March 25, 2010 no body knows...?(spaceballs) Quote Link to comment https://forums.phpfreaks.com/topic/196263-mod_rewrite-numeric-parameter-value-to-name/#findComment-1031619 Share on other sites More sharing options...
cags Posted March 26, 2010 Share Posted March 26, 2010 It is impossible to use mod_rewrite to convert a name to a number. You will either have to include the numbers in the URL in some way or you will have to make your script either use the name instead of the id, or find the id from the name. Quote Link to comment https://forums.phpfreaks.com/topic/196263-mod_rewrite-numeric-parameter-value-to-name/#findComment-1031975 Share on other sites More sharing options...
GregL83 Posted April 21, 2010 Share Posted April 21, 2010 what you are trying to do is accomplished using a slug system. instead of using an internal numerical id query your database based on the cityname (with indexing). this is similar to someting that you would see from wordpress. Quote Link to comment https://forums.phpfreaks.com/topic/196263-mod_rewrite-numeric-parameter-value-to-name/#findComment-1045557 Share on other sites More sharing options...
dflow Posted May 2, 2010 Author Share Posted May 2, 2010 thanks i resolved it with switching the parameters Quote Link to comment https://forums.phpfreaks.com/topic/196263-mod_rewrite-numeric-parameter-value-to-name/#findComment-1051954 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.