# Blog posts and guides created in the admin panel:
#   /blog/my-post.php   (or /blog/my-post)    -> blog/view.php
#   /guides/my-guide.php (or /guides/my-guide) -> blog/view.php?type=guide
# Real files (your older static posts / guides) are served as normal because of the !-f check.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^blog/([a-z0-9-]+)\.php$ blog/view.php?slug=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^blog/([a-z0-9-]+)/?$ blog/view.php?slug=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^guides/([a-z0-9-]+)\.php$ blog/view.php?slug=$1&type=guide [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^guides/([a-z0-9-]+)/?$ blog/view.php?slug=$1&type=guide [L,QSA]
