How do I change the root directory of a site?
There is a hosting service, cPanel is on it, I installed laravel
and CMS
built on this framework there.
The final touch that remains to be done (judging by the developers ' manual) is to replace the root directory of the site with public_html
to public_html/public
, so that the loading of scripts, styles, etc., etc., works correctly
In cPanel itself, I did not find the ability to change the root directory of the site, maybe there is a way to do this in .htaccess
or in httpd.conf
?
0
Author: Klimenko Kirill, 2017-08-03
2 answers
You can just write the application path in httpd. conf
DocumentRoot "/path_to_laravel_project/public_html/public"
<Directory "/path_to_laravel_project/public_html/public">
Or in .htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^(.*)$ public_html/public/$1 [L]
</IfModule>
1
Author: Dmitriy Doronin, 2017-08-03 12:09:21
You need to create a symbolic link from the project folder via SSH
Ln -s public/ public_html
0
Author: Andrew V., 2017-08-04 02:28:35