I have a social network that allows users to write blogs and ask questions. I am wanting to create dynamic URLs that post the title of the blog or question on the end of the URL via PHP.
Example:
www.blah.com/the_title_here
Looking for the cleanest most efficient way to accomplish this.
You would usually store the URL-friendly “slug” in the database row, and then have a PHP script that finds posts matching that slug.
For example, if you have a script called
index.phpthat took a parameter calledslug……You could then re-write requests using .htaccess: