Question

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)

Was it helpful?

Solution

In you .htaccess file, wtite this:

RewriteEngine On

RewriteRule ^question/([a-zA-Z0-9_-]+)$ question.php?qid=$1
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top