Hosting and domains·27 questions

What are symbolic links on hosting and how to use them to optimize the site structure?

Answer

A symbolic link is a special file in the file system that points to another file or directory. Using such links allows you to access the same data from different parts of the directory structure without physically duplicating it.

In practice, web developers often use symlinks for efficient file management on hosting. For example, this is an indispensable tool when deploying modern framework-based sites, when the web server root folder must point to a subfolder of compiled assets.

Creating symbolic links helps save disk space and simplifies project update processes. Instead of copying heavy media folders with each new release, you can simply set up a link to a single storage.

To work with symbolic links, the following steps are usually performed:

Connect to your hosting via the SSH protocol.
Use the standard link creation command, specifying the path to the source folder and the path to the link being created.
Make sure in the web server settings that it allows the processing of symbolic links for your domain.
Was this answer helpful?

More questions in this topic

Related questions from other topics