I’ve organized my Yii files on my host in a particular way (and it works) but there is one last thing that bugs me.
Here is what I have so far :
The framework itself and the db (sqlite) are stored outside the document root
The application (blog) is in webroot/blog/
The bootstrap file index.php is in the webroot, $yii and $config having the correct paths.
In order for this setup to work, I had to add the following code to my main.php :
'components'=>array( ... 'request'=>array( 'baseUrl'=>'/blog', ),...
I did all of this because I wanted the URL www.mysite.com to fetch the code in www.mysite.com/blog/ (and not actually displaying www.mysite.com/blog/). At first I used .htaccess and rewriterules, but it kept redirecting me to www.mysite.com/blog/.
So now it works the way I want it, except that when I go to www.mysite.com/blog/, I’m getting the index of the whole directory (assets, css, scripts and themes). I tried to put a “deny from all” htaccess, just like in the protected folder, but then I lose all my CSS design because webroot/blog/css becomes forbidden…
Any suggestions ?
PS : I tried to access the css folder of the online blog demo, but they managed to protect it. How did they do without losing their design ?