How to stop printing a source code from twig files in the browser (Timber for WordPress)?

I use Timber for WordPress.

Currently I’m able to see my all source code from twig files in the browser.

Example: localhost:8000/wp-content/themes/name-of-theme/views/base.twig

when hitting this url I can see code from base.twig file.

How to stop rendering twig files in the browser or redirect them from /views/*.twig completely? Is it possible with Timber or need special configuration with .htaccess globally? I would like to configure it inside my theme – which folders and files can be viewed by the browser. I think it’s not secure because anyone can see logic from my twig files if has its name.

Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.