Bought a 50 block a year of space, support PHP, but the root directory is set to die for www, that is to say index.html index.php must put here, but Laravel framework index.php must be put in public inside, how should I do?
Reply content:
Bought a 50 block a year of space, support PHP, but the root directory is set to die for www, that is to say index.html index.php must put here, but Laravel framework index.php must be put in public inside, how should I do?
LaravelSuch a good frame is really not suitable for virtual hosting, really recommend the purchase of ECS products.
There are, of course, some solutions: 1. First put the ./public directory down, .htaccess move it index.phpfavicon.ico outside (with app , bootstrap , public , folder on the vendor same layer) 2. Modificationsindex.php
This should be able to change, although I have not tried ha. In fact, the directory you can use on the server is /root directory /www Web Directory You can use WWW as public, and then the other source in the root directory can be, in adjusting the settings, feel the problem is not very large. I use this experience, however, the previous version has bootstrap/paths.php, which has ' Public ' = __dir__. ' /.. /public ', Just change it, okay?
Another is to look at the documentation provided by your service provider, is it possible to customize some settings, and some hosts allow users to extend Apache configuration files and custom php.ini.
The practice of placing publicly accessible resources under public is to protect other sources from accidental access, so it is not recommended to set the common and normal source to the same directory.
Do a soft connection to map www to public can?
In fact, there is a very simple way, you can rename the root directory of the server.php to index.php No. When you visit, you http://XXX.com/index.php/your route.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.