From 3fafe5e5e081cfa52ff964abfa35013fddc4822c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zden=C4=9Bk=20Borovec?= Date: Wed, 3 Jan 2024 11:01:28 +0100 Subject: [PATCH] redirect files without extension --- docs/www/.htaccess | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 docs/www/.htaccess diff --git a/docs/www/.htaccess b/docs/www/.htaccess new file mode 100644 index 0000000..c78f08e --- /dev/null +++ b/docs/www/.htaccess @@ -0,0 +1,13 @@ +Options +FollowSymLinks +RewriteEngine On +RewriteBase / + +# Add trailing slash to url +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/|#(.*))$ +RewriteRule ^(.*)$ $1/ [R=301,L] + +# Remove .php-extension from url +RewriteCond %{REQUEST_FILENAME} !-d +RewriteCond %{REQUEST_FILENAME}\.php -f +RewriteRule ^([^\.]+)/$ $1.php