My hosting service does not allow the creation of folders outside the public (www/
) directory. However, for subdomains it automatically creates folders outside www/
, for example laravel/
.
I copied the content of my Laravel 4 app's public/
folder into www/
and the rest into the laravel/
folder, adjusted paths, etc. so the site works, but I don't want to inadvertently serve anything from laravel.mydomain.com
.
What are the best practices in .htaccess, deny from all
or a simple Redirect 301 / mydomain.com
?
I guess a redirect exposes that the subdomain exists, so it may not be ideal. Any issues I could have with deny?
Thanks.
EDIT: I went with Redirect 301 / http://mydomain.foo
in a .htaccess
file that resides in the folder where the non-public files of the Laravel app are and which Apache serves laravel.mydomain.foo
from. mydomain.foo
is served from the standard location the hosting service provides and contains the public files. One year down the line it has not bitten me yet. The question is still open if someone has a better approach.