It’s just because there should be no files in “common” directory that should be accessed directly from the end user. You will find the same .htaccess in “framework” directory of Yii.
I want to be able to access all files in common.myfiles.* so that I can store all my shared code and views there. I don’t want to require_once() all the files individually.
CSS files, javascript files and image files are requested by the web server directly. They have to be under the public directory. But the layouts and views are not.
There are many CSS/scripts/images bundled with Yii, and they are under the protected directory. In order to allow the web server to access them, Yii will "publish" them under the "assets" folder using CAssetManager. And the "common" directory of YiiBoilerplate is assumed to be a protected directory.
So, what you want to do will be …
Store CSS/scripts/images under your "common.myfiles" directory. And publish them under "backend.www.assets" and "frontend.www.assets".
Store CSS/scripts/images under your "common.myfiles" directory. And create symbolic links in "backend.www" and "frontend.www".
I have the same problem and have been wrestling for weeks now.
I do have backend where Admins logs in and Posts some Text accompanied by images usong redactorjs. Well they work fine with backend. I’m now struggling on how non-registered users who cannot access backend but front end will access the images. They can see Text since it is in the database but not images which are under backend/www/uploads.
Any idea on how to resolve such problem? I want to display images as well from front end that are stored in backend!
Save images in the front end when you are in the back end.
If the both of the ends are the virtual hosts of a single server, and if the server configuration is under your control, then you can create a symbolic link to a front end directory in the back end.
(I mean, linking "/backend/www/upload" to "/frontend/www/updload")
Load images in the back end when you are in the front end.
You should be able to access the image files in the back end by specifying the full url of them even when you are in the front end.