How to create dynamic page for blog post

Hi guys,

I’m building a simple blog. So basically I have a homepage with some thumbnails of recent/featured blog posts. When you click a thumbnail, you should go to a page displaying the real content of the blog post. However, I’m not sure what’s the best way to create this page.

Is it okay to work with a querystring and the blog post ID and then just let PHP generate all the content from the database, like this:

This looks like a no-go having SEO in mind. Does it make any difference if I would use this:

Also, I don’t see a lot of blogs using querystring to display blog posts. Take Sitepoint for example, when you click a blog post you get a link like this:

How does this work, this is still a dynamic generated page, right? Is this some .htaccess rewrite trick? Or do people really generate full html-pages and store them on the server when they create a blog post?

So what’s the best approach to create this page for blog posts.

Many thanks!

I’ve dont it with .htaccess URL rewriting thanks to this nice tutorial: :smile:

So now when a user clicks a thumbnail, I link them to That’s the link they’ll see in the address bar, but actually the content of the page will be loaded. Neat!

This is my .htaccess code

RewriteEngine On
RewriteRule ^blog/(.+)/(.+)$ blogpost.php?id=$1 [L]

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.