A
A
ADA M2015-05-21 21:59:14
Yii
ADA M, 2015-05-21 21:59:14

How to move Yii2 files out of server scope on regular hosting?

As I understand it, there are 2 methods for protecting the site's internal scripts:

  1. Denying access to folders with scripts using .htaccess
  2. Moving folders to a higher level (outside the scope of the server) that should be inaccessible.


If there are other ways, please share.

Using Yii2 as an example, how to properly place it on a regular hosting, where the root directory is "public_html/" from a security point of view?

At the moment, my Yii2 application is located on the local Open Server (in general, the structure is similar there, only instead of "public_html" the directory is "domains").

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
matperez, 2015-05-21
@matperez

It's not entirely clear what you mean by scripts.
In public_html, you can leave only public files that you can give to users without fear. For example, https://github.com/yiisoft/yii2-app-basic/tree/mas... Everything else can be anywhere, as long as php has access to it.
js, css, and more can be published through the assets www.yiiframework.com/doc-2.0/guide-structure-asset... and stored separately as well.

A
ADA M, 2015-05-22
@adiletmurzaliev

Could you show how to do it with an example? (Let's say on the local server Open Server)
Type what folders where to place, and what to register in the server settings or in .htaccess.
P.S. The github link is not working.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question