Hi all
I would like to map human readable URLs to the PHP generated URLs on my page.
For instance I would like users to be able to type [url]http://www.mysite.com/a-brand-new-article.php[url]http://www.mysite.com/art.php?aid=1
I currently do this by having a custom 404 script set up in apache. All the human readable requests generate a 404 and the script will query the DB and map the article name to the article ID. Then the script will send a header response and another page will then retrieve the content using the article ID.
This however imposes some overhead (2 request for every page view) as well as filling up the Apache error log with a huge amount of 404 entries.
1: How do I avoid that the user will see [url]http://www.mysite.com/art.php?aid=1[url]http://www.mysite.com/a-brand-new-article.php
2: Can I use mod rewrite to do this? (how would you access the DB?)
3: Maybe I need another approach to the solution?
Any help is appreciated.