Skip to content

Commit

Permalink
[Tests] IBX-7818: Fixed direct acces to index.php with long URL
Browse files Browse the repository at this point in the history
  • Loading branch information
micszo committed Oct 3, 2024
1 parent 805eb8c commit e6ac11f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion templates/apache2/vhost.template
Original file line number Diff line number Diff line change
Expand Up @@ -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
</IfModule>
Expand Down
2 changes: 1 addition & 1 deletion templates/nginx/ez_params.d/ez_rewrite_params
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit e6ac11f

Please sign in to comment.