Hey all, I have been searching and searching no luck yet. I think what i have come up with is using apaches rewrite map, but clueless as to where to begin.
Here is the situation I have. I have a url http://www.somesite.com/post.php?id=13
and want to turn it into a SEO friendly url like http://www.somesite.com/{dynamic_article_title}.php
The title is being pulld from a MySQL table.
Any suggestions as to where I should start or possible examples? Am I on the right track with Rewrite map?
Thanks in advance!
First you need to write your php script in such a way that instead of article id you can pass an article title.
For example instead of post.php?id=13
it should be post.php?id=my_article_title_goes_here
Your php script will then replace underscores with spaces and then pull the article from database using the title instead of article ID.
Once your php script works, you can add a rewrite rule to .htaccess or httpd.conf
RewriteRule ^/([a-zA-Z_\-]+)/\.html$ /post.php?a=$1 [QSA,L]
See this - you can even use the .html extension in your url to make it really look like a static url