Tierra Perdia
Tierra Perdia

Reputation: 1

installing yii2 on a host that does not allow placing files outside of the htdocs folder

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.

Upvotes: 0

Views: 23

Answers (2)

Tierra Perdia
Tierra Perdia

Reputation: 1

The real solution was to use the kartik practical-b skeletal template that is adapted for what I wanted. The files and folders were carefully organized to perform the installation in the webroot.

I hope it is useful for someone.

Upvotes: 0

Tierra Perdia
Tierra Perdia

Reputation: 1

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.

Upvotes: 0

Related Questions