The problem is, as the title mentions, how to install yii2 on a hosting that does not allow files to be placed outside the htdocs folder.
the hosting is byhost: not allow files to be placed outside the htdocs folder.
what alternatives do I have?
We know that for security most of the folders of a yii2 app should go outside of the htdocs folder, so what can I do to prevent people from having access to these folders or redirect any attempt to access for example the config, vendor folder? , etc?
For example, when you enter the browser and write www.my_app.com/vendor, all the files that that folder contains are listed.
What do you suggest?
Actually I have not tried anything and I can not think of what I can do, I have searched for information but I did not find anything.
I solved it by following this post.
Deploying Yii2 into shared hosting, Directly to basic template folder
The solution is an htaccess file, in the root of the htdocs folder and another htaccess file in the web folder.