Skip to content

Commit

Permalink
Fix EZP-27285: Prevent access to website with direct usage of index.p…
Browse files Browse the repository at this point in the history
…hp in URL
  • Loading branch information
adamwojs committed Jul 26, 2017
1 parent 8d6ff00 commit 516e504
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doc/apache2/vhost.template
Expand Up @@ -138,6 +138,9 @@
#RewriteCond %{ENV:ENVIRONMENT} "dev"
#RewriteRule .* /index_dev.php [L]

# Prevent access to website with direct usage of app.php in URL
RewriteRule ^/(.+/)?index\.php - [R=404,L]

RewriteRule .* /index.php
</IfModule>

Expand Down
5 changes: 5 additions & 0 deletions doc/nginx/etc/nginx/ez_params.d/ez_rewrite_params
Expand Up @@ -35,5 +35,10 @@ rewrite "^/w3c/p3p\.xml" "/w3c/p3p.xml" break;
# Following rule is needed to correctly display assets from eZ Publish5 / Symfony bundles
rewrite "^/bundles/(.*)" "/bundles/$1" break;

# Prevent access to website with direct usage of index.php in URL
if ($request_uri ~ "^/(.+/)?index\.php") {
return 404;
}

rewrite "^(.*)$" "/index.php$1" last;

0 comments on commit 516e504

Please sign in to comment.