从一个php文件生成时的自定义URL

Ok, so I've got a file named generate.php. It takes values from the database and generates a dynamic page based on the database id contained in the url.

Link example:

<a href="/pages/generate.php?id=1"></a>

So where it lands is domain.com/pages/generate.php?id=1. I'd like to use custom urls generated from the title like, for example, stackoverflow has: (https://stackoverflow.com/questions/101268/hidden-features-of-python).

Any tips?

Thanks.

Use .htaccess, to rewrite the URL, to have the custom address. example:

RewriteEngine On RewriteCond% {REQUEST_FILENAME}! -f RewriteCond% {REQUEST_FILENAME}! -d RewriteRule ^ (. *) $ Index.php / $ 1 [QSA, L]