From a4503168582978a8c0d5ce29b266dafeab446809 Mon Sep 17 00:00:00 2001 From: Ludwig Lehnert <ludwig@lehnert.dev> Date: Mon, 21 Apr 2025 17:35:59 +0000 Subject: [PATCH] fixed .htaccess --- www/.htaccess | 4 +++- www/blog.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) 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/<ID> to /blog.php?id=<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=<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'); } ?><!DOCTYPE html>