Mortier Posted January 4, 2007 Share Posted January 4, 2007 Hello people!I'm trying to make an .htaccess RewriteRule with an id-name association.For instance you have an URL like this:[code]http://www.example.com/{news_article}.html[/code]and you want it to point to:[code]http://www.example.com/index.php?news={article_id}[/code]Any idea how I should realize this because {news_article} != {article_id}. The {news_article} can be looked up in an MySQL table using PHP but how should I integrate that here? Or is there another way?Thanks in advance,Mortier Link to comment https://forums.phpfreaks.com/topic/32879-rewriterule-with-id-name/ Share on other sites More sharing options...
wildteen88 Posted January 9, 2007 Share Posted January 9, 2007 If your script uses an id to identify an article, you will need to change your script to identify the article with the article name instead. mod rewrite cant convert a name to a number. mod_rewrite is only used to create a user friendly url which masks the true URL. Link to comment https://forums.phpfreaks.com/topic/32879-rewriterule-with-id-name/#findComment-156756 Share on other sites More sharing options...
Mortier Posted January 9, 2007 Author Share Posted January 9, 2007 Ok then i'll have to do like ?news={article_name} Well I don't have much choice I guess. Thanks for yuor help. Link to comment https://forums.phpfreaks.com/topic/32879-rewriterule-with-id-name/#findComment-156830 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.