Should all files be located publicly?

Solutions

The doc root should be where index.php is; that's where all requests for non-existent files are rewritten to.

If you mean "should the application and the front end be separate, like in other frameworks?", then yeah, maybe they should. But they're not at the moment, if memory serves there was a declined issue about doing just that when D8 was first being planned.

Similar questions

Drupal can't create image styles for files located in theme directory
I have an image located in sites/all/themes/mytheme/images directory. I'm displaying it programmatically with attached image style like: First error: 404: "NetworkError: 404 Not Found - http://j.dev/sites/default/files/styles/my_style/public/sites/all/themes/mytheme/images/img.png?itok=qsTbAc8I" Log report: Source image at public://sites/all/themes...
How can I load CSS files located outside the web root from within a custom module?
I need to store my css files at a location outside Drupal's path (e.g. /srv/assets/css/my_site/general.css). I attempt to achieve this using drupal_add_css but the browser loads them from: http://www.my-site.com/srv/assets/css/my_site/general.css which results of course in 404 error. Any idea how to load those external (file system) CSS files from ...
Sharing the same templates by importing PHP files: Where should I store those PHP files?
I want to be able to just edit standard PHP files which are then imported into many themes. I feel like a module is an overkill, so I'm happy with just a folder of files.
Should all files/folders in an installation be owned by the web server user?
As in the title, should all files/folders in a Drupal 8 installation be owned by the web server user, e.g. the default www-data user for Apache? As far as I know, the answer is yes at least in principle, so that all files/folders should have www-data as both owner and group, and more so because of logistics/minimalism/ease of management. Is that co...
Should I use all these template files or will theme hooks do the job?
Since templates are slower than theme hooks, I'm wondering if I might be able to use them for my application. Here's what I'm trying to do: Right now I have about 10 content types on my site and I've created a separate template file for each because I want each to have a <div> with a specific 'id' so I can target those pages with CSS. I also ...
Where is the logic located which determines the tpl file for the front page?
We are using Drupal 6. When accessing http://www.mysite.com/, the tpl file which is displayed is named page-front_page.tpl.php. I cannot figure out where the logic is which decides that page-front_page.tpl.php will be used for the front page. I created a second file, named page-front.tpl.php, and this will display instead of page-front_page.tpl.php...

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy.