Plain URLs from dynamic PHP page

98 views Asked by At

I am creating a question and answer site using PHP. Questions are viewed on one page using 'question.php?qid=1234', is the the correct thing to do, if so how to I make pages have URLs that search engines like StackOverflow (e.g. 'http://mysite.com/question/1234'). I am using Apache and MySQL. I have add a look around but I still don't quite understand what to do. Thanks in advance :)

(Sorry if this has already been asked)

1

There are 1 answers

0
Arvind Bhardwaj On BEST ANSWER

In you .htaccess file, wtite this:

RewriteEngine On

RewriteRule ^question/([a-zA-Z0-9_-]+)$ question.php?qid=$1