Our default web root is named public
. You cannot change the actual web root, but you can symlink the default (forced) web root to another folder. This has the same effect, without implications on the rest of our stack. A symlink works as an alias of the web root.
Steps in this guide include SSH commands. Here’s an article for you when you’re not familiar with how to log in 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
newpublic
that will be our new web root:
Navigate to the home directory of your site with:cd ~
orcd $HOME
- 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 web root with this command:
ln -s newpublic public
The new public folder will look something like this: