From e6ac11fd95f97551c0078ea6b8bac9a7fc0f6b82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Szo=C5=82tysek?= Date: Thu, 3 Oct 2024 12:16:54 +0200 Subject: [PATCH] [Tests] IBX-7818: Fixed direct acces to index.php with long URL --- templates/apache2/vhost.template | 2 +- templates/nginx/ez_params.d/ez_rewrite_params | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/apache2/vhost.template b/templates/apache2/vhost.template index 6793ea6..9c9f852 100644 --- a/templates/apache2/vhost.template +++ b/templates/apache2/vhost.template @@ -100,7 +100,7 @@ RewriteRule ^/(css|js|fonts?)/.*\.(css|js|otf|eot|ttf|svg|woff) - [L] # Prevent access to website with direct usage of index.php in URL - RewriteRule ^/([^/]+/)?index\.php([/?#]|$) - [R=404,L] + RewriteRule ^/([^/]+/)*?index\.php([/?#]|$) - [R=404,L] RewriteRule .* /index.php diff --git a/templates/nginx/ez_params.d/ez_rewrite_params b/templates/nginx/ez_params.d/ez_rewrite_params index d2798f0..166f7f8 100644 --- a/templates/nginx/ez_params.d/ez_rewrite_params +++ b/templates/nginx/ez_params.d/ez_rewrite_params @@ -19,7 +19,7 @@ rewrite "^/build/(.*)" "/build/$1" break; rewrite "^/assets/(.*)" "/assets/$1" break; # Prevent access to website with direct usage of index.php in URL -if ($request_uri ~ "^/([^/]+/)?index\.php([/?#]|$)") { +if ($request_uri ~ "^/([^/]+/)*?index\.php([/?#]|$)") { return 404; }