Search the Community
Showing results for tags 'docroot'.
-
Hi there and thanks for a perfect product! PW seems to get more and more popularity, and its flexible power begins even to rival the frameworks like Laravel. I really like PW, and that's why i see some ways to make it even better. Frameworks are often installed OUTSIDE the document root. There's a lot of reasons to do so. Some of them: Security. Every piece of code placed inside docroot is a potential security breach. So we are to keep only a minimal amount of code inside docroot. Website engine obfuscation (and more security again). Anyone can check for presence of /site and /wire folders via http -- and if they're here then it's a Processwire inside webroot with almost 100% probability. Possibility to share the same codebase between several websites placed at the same server (it's really cool!). A nice opportunity to create a static site generator (and PW has it all to become such a generator with minimal coding). But, unfortunately, it's not the case for PW right now. PW is currently designed to be placed only inside webroot. And there's no clear way/guideline how to move PW to an arbitrary directory outside webroot. At least i couldn't find any. OK, there will be however some obvious problems while moving PW outside webroot: Many hosters deny ftp/ssh access above webroot. So it will be impossible to upload/download anything inside /site (at least using ftp/ssh clients). There will be some confusion/ambiguity with /site/assets/files . In most cases they should be accessible via http, so they need to be located inside webroot. But, hmmm, what about 'special' files like hi-res images which are to be protected from occasional downloads? Yes we can write some .htacces to protect them -- but placing such files above webroot is a better practice. Tried to 'bruteforce' my idea by moving /site and /wire from fresh PW 3.x installation one level up my webroot and applying some tweaks to /index.php . No success at this time. Had some core-level errors. PW seems to dislike my experiment, core changes are needed. My whishlist? A possibility to define path (absolute or relative to webroot) for /site (except /assets) and /wire during installation and/or after it via config.php file and/or something like $config inside /index.php . A possibility to separate /site/assets into /webroot/something_like_public_assets (this path should be configurable) and /outside_webroot/something_like_private_assets (this path, of course, should be configurable too). A possibility to change/configure paths after installation. Hope this idea is really important for the future of PW. Will be glad to see a deeper discussion here.
- 6 replies
-
- 1
-
- document_root
- $_server[document_root]
-
(and 3 more)
Tagged with: