Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I created a site on a testing server on my local Windows machine, and now I wish to port it to a remote server which is Linux. Both sites running under Apache.

To create symlinks on Windows, is stopped the server, and used mklink /d source destination, and I was careful to use relative syntax - eg. ..\imgdir instead of C:\htdocs\imgdir. I don't know if that matters, but it made sense in my brain. Started the server, symlinks work fine.

However, when I upload the site with FTP, the symlinks are gone. The folders just disappear. Is this to be expected? Is there are solution?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

This is expected behavior - FTP doesn't know anything about symlinks and cannot create them - it operates on regular files and directories. Even if supported, I don't really see how it will work. Windows symlinks are different from linux symlinks.

share|improve this answer
    
This is what I feared. Makes a cross platform testing server seem like a bad idea. Here's a weird twist though: I made up a quick test the first time I tried it. I made a directory structure like 1/2/3/4/5, and then in 5 created a symlink to ../../3. I uploaded that, and that worked: sort of. It created an infinitely recursive directory on Linux. –  user1167442 Sep 8 '13 at 13:02
    
cross platform testing isn't bad idea in this case. using symlinks with web is a bad idea, most of the hosting providers won't allow web server to follow symlinks. –  GioMac Sep 8 '13 at 13:04
    
use .htaccess/mod_rewrite to forward requests –  GioMac Sep 8 '13 at 13:05
    
I think I'll just create a shell script to recreate the links. –  user1167442 Sep 8 '13 at 14:07
    
Bad way. Use rewriting rules. Symlinks aren't available everywhere. –  GioMac Sep 8 '13 at 17:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.