Sl-Alex home lab

Creating symbolic links in cPanel

Views: 3074Comments: 0
Notes

Translation: RU
Creating symbolic links in cPanel

Once upon a time I had a problem with creating symbolic links in cPanel. My goal was to make two websites copies with one shared "Uploads" folder.

Native website engine did not have such feature, htaccess did not work in this case, so my decision was a little tricky, but very easy.

In fact, it's very easy. As you know, cPanel have an ability to create and maintain cron tasks. So here the code:

ln -s /full/path/to/target/dir /full/path/to/link

I created new task with one minute interval, and after one minute I deleted this task. Links were created.

Good luck!

P.S. If you have spaces or other special symbols in your path — don't forget about escaping this symbols.