0

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.

2 Answers2

0

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]

0

For anyone who happens to end up here:

https://www.addedbytes.com/blog/url-rewriting-for-beginners