PDA

View Full Version : Symlink: from htaccess instead of telnet command ?


Benj
10-30-2006, 09:33 AM
Hi,
I need to setup a symbolic link so I use this from telnet

ln -s -f /big/dom/mysite/www /big/dom/mysite/www/cb/directory/

Is there a way that I could create the equivalent in Htaccess instead of having to login telnet ?

Benj

sheila
10-31-2006, 02:44 AM
.htaccess files are for sending configuration options to the Apache web server.

symlinks are file system thingies. They are independent of Apache. Two things that are completely unrelated.

You need some kind of shell access to create a symlink. You could possibly create one with a cron job (you'd need a script). If you wanted to create sym links on some kind of recurring basis, that might be a way to go...

I guess I'm wondering why you wanted to avoid telnet and what made you consider .htaccess as a way to do this? What problem are you trying to solve? Why did you think .htaccess would be "nicer" than using telnet?

Benj
10-31-2006, 07:23 AM
Hi Sheila,
thanks for your answer.

I'm just more comfortable adding a line to htaccess than from telnet: easier to remember, visualize....

Once the symlink is set, and you want to delete it or change it, it is easier if it is in htaccess..

But no problem, I managed to install it from telnet.

Thanks,
Benj

hobbes
10-31-2006, 12:04 PM
You should be able to use RewriteRule or something similar if you really want to accomplish it via .htaccess. See http://httpd.apache.org/docs/1.3/misc/rewriteguide.html for more info.

Although I prefer symlinks, reasons for not wanting to use a symlink include potential issues when backing up the link via FTP (it could be copied vs. re-linked), and should you transfer the site to a Windows environment you would need to re-create it as a shortcut as no symlinks are available.