I have a site tha is written in PHP and pulls data from a MySql DB. The site utilises query strings and I would like to map the query generated pages to the more search engine friendly page titles. For example I would like to acheive to the following mappings:
content.php?id=1 to map to /aboutus
content.php?id=2 to map to /contactus
content.php?id=3 to map to /newfiles
how can i do this, in a more simple way. is that simply changing .htaccess file, or is that related to rewrite mapping function. pls can you give me hint and exact example would be great. thanks
You need a field called permalink (or similar) in your database. e.g.
Then use this in your .htaccess file
What above .htaccess does is recognize your url in first level and pass it to url variable. e.g. when user type
It will actually request to
(but user don't see it)
then you use $_GET['permalink'] to match your database and get content display on the screen.