0

Is it possible to do this thing? I'm trying to deny all and allow localhost in /location in nginx config but this does not work.

This is struct my files:

  • index.php
  • templates/__NEW/ (here are files like index.html)

If user write in address bar link-to-site.com/templates/__NEW/, user see content of index.html which contain twig variables. I want to block access via addres bar, but index.php sholud render file index.html in templates, any images, css, etc. If i block access to this location, from web isn't possible to get images or other files.

Is it possible? Secure this location from access wia bar address, not block for script rendering this file.

kasperd
  • 29,894
  • 16
  • 72
  • 122
furyxpl
  • 9
  • 1

1 Answers1

0

The best way is to move templates and static assets into separate sub-directories and deny access to template sub-directory while allowing access to static assets sub-directory.

AlexD
  • 8,179
  • 2
  • 28
  • 38