Frage

how can i know where is my web root folder ? and how to put folders out of web root folder? and how to test that they are not accessible from outside ?

the structure of my hosting is like this:

www.website.com :

public_html/
includes /
logs/

...

is it enough to protect includes folder and logs folder with htaccess? and are they out of web root in this case?

i know that $server[document root] provide the root of my website , but i am confused about how to put files out of it , any help would be welcome , thanks for all

War es hilfreich?

Lösung

All your files are currently in the public web root folder.

The 'inside' of your root is your publichtml/. Everything you place in there will be publicly accessible. The name of your root can vary from host to host, often public_html or httpdocs.

The 'outside' is one directory up. But remember some hosts do not give enough permissions.

You cannot test documents outside your root, because they are not accessible. Only something like PHP can access those files. That's why you do not place your img/JS/CSS files outside the root cause they need direct access. You can however serve them through your PHP.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top