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; }