There is a variety of methods to build a symlink in cPanel:

1. You can make a symlink via SSH by running the following command:

ln -s /route/to/goal /path/to/shortcut

2. It can also be made via a cronjob employing the exact same command:

Note: Make absolutely sure that you delete the cronjob the moment the symlink has been developed.


3. You can also create a symlink making use of the PHP functionality.
The illustration of the script can be located below:

$target=”/home/cPanelusername/public_html/index.html”
$shortcut=”script.html”
symlink($target, $shortcut)
?>
Just operate this PHP file in the browser and it will produce symlink correct away. 

Instance of the symlink utilization
A symlink may well be a perfect resolution for a range of cases. In our example we will use a symlink in buy to use visuals situated in the primary domain world-wide-web root (/general public_html/) for the addon area website (/general public_html/area1.com):
Considering that the addon domain site does not have entry to /public_html or any bigger degree directory, the only way to use images located in the /community_html/pictures folder is to make a symlink in the addon area folder:
ln -s /property/ncexample/general public_html/visuals/ /home/ncexample/public_html/domain1.com/photos

As you can see, symlinks will help you to avoid duplicate material if you use the very same documents for numerous websites.


Observe: Producing symlinks to root directories of other internet sites may result in significant safety breaches, that’s why we hugely advocate utilizing symlinks only for all those folders that do not expose any config or program documents, as, if acquired, this kind of documents may possibly be utilized for hacking or other destructive action.




Which is it!
Require any support? Get hold of us by using HelpDesk
Recent Comments