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 Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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.