How to create symbolic link in cPanel?

Symlinks - short for symbolic links are basically shortcuts to individual files or folders. One of the advantages of the symlink is that it can cross file systems, as it references abstract filenames/directories, not physical locations.

 There are two ways to create symlink in cPanel:

 1. It can be created via cronjob using the command:

ln -s /path/to/target /path/to/shortcut

 NOTE: make sure to delete the cronjob once the symlink has been created.

2. You can also create symlink using PHP function.

 The example of the script can be found below:

 <?php

$target = '/home/cPanelusername/public_html/index.html';

$shortcut = 'script.html';

symlink($target, $shortcut);

?>

Just run this PHP file in the browser and it will create symlink right away.

  • create, symbolic, link, cpanel
  • 113 Users Found This Useful
Was this answer helpful?

Related Articles

How to Backup your cPanel account from your previous server?

Here we are explaining about how to move your cpanel to our server. This is a very simple...

How to use cPanel?

cPanel is a world popular hosting control panel. It make easy to manage your hosting account. You...

Accessing cPanel from a dynamic IP address

If you get logged out from cPanel and get an error The IP has changed, then it is possible that...

How can I check my website access logs?

Using Raw Access Logs menu in cPanel you can check the traffic coming to your website, before it...

How do I add an Apache handler?

1. Click on the “Apache handlers” link in Cpanel. (under the 'site management header.)2. Enter...

Powered by WHMCompleteSolution