Our default webroot is named
public. You cannot change the actual webroot, but you can symlink the default (forced) webroot to another folder. This has the same effect, without implications on the rest of our stack. A symlink works as an alias of the webroot.
Steps in this guide include SSH commands. Here’s an article for you when you’re not familiar on how to use login using SSH.
How you can do it:
Time needed: 5 minutes.
Symlink the public folder to the project’s public folder. You can do so with the following steps:
- Make the new folder
Navigate to root and make the folder you want to symlink to. In this case we want to make a new folder called
newpublicthat will be our new webroot:
Navigate to home directory of your site with:
- Move to the correct folder
Move the public folder to the new folder with:
mv public newpublic
- Symlink new folder
Symlink the new folder to act as your new webroot with this command:
ln -s newpublic public
The new public folder will look something like this:
Give us your feedback on this article
Want to speed up your site, easily?
Set up your site on Servebolt, free of charge for 60 days, and see for yourself how fast it can be on our extremely fast hosting.
A faster site converts better, ranks better on Google, and is better for the climate.