diff --git a/www/.htaccess b/www/.htaccess index 8fcd2e6..fda3ded 100644 --- a/www/.htaccess +++ b/www/.htaccess @@ -1,9 +1,11 @@ RewriteEngine On +RewriteBase / # ------------------------------------------- # Rewrite /blog/ to /blog.php?id= # ------------------------------------------- -RewriteRule ^blog/([^/]+)/?$ /blog.php?id=$1 [L] +RewriteRule ^blog/([^/]+)$ /blog/$1/ [L] +RewriteRule ^blog/([^/]+)/$ blog.php?id=$1 [L] # ------------------------------------------- # Rewrite /sitemap.xml to /blog.php?id= diff --git a/www/blog.php b/www/blog.php index 3bffeee..b9290cf 100644 --- a/www/blog.php +++ b/www/blog.php @@ -18,7 +18,7 @@ $rand_send_comment = mt_rand() % 5; function is_external_url(string $url): bool { - return !str_starts_with($url, '#'); + return str_starts_with($url, 'http'); } ?>