Find the answer to your Linux question:
Results 1 to 3 of 3
Hi. I'm using Linux (Sme server) as a web server. By default, Sme server create s three folders for each site, and index.php and the other files and folders are ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2008
    Posts
    4

    Redirect a folder to another so I can access files


    Hi.

    I'm using Linux (Sme server) as a web server. By default, Sme server create s three folders for each site, and index.php and the other files and folders are inside the html folder, like this:

    cgi-bin
    files folder 1
    html
    -files folder 2
    -...
    -index.php

    When I upload files through the website (using drupal 5.2), they get into the files folder 2, which is ok, however, when I try to download the uploaded files, I get an error, because the files are looked for in the files folder 1 outside folder html; however, if I copy the uploaded files from 2 to 1, I can download normally.

    I think the problem occurs because files are looked into nameofwebsite.com/files, and thus files folder 1.

    So, how can I have a folder redirected to another? Is there a way to create something like a link so that when files are looked for in folder 1, files from the folder 2 are taken?

  2. #2
    Linux Newbie
    Join Date
    Jan 2008
    Location
    UK
    Posts
    211
    have a look at:
    man symlink
    on the command line to see if that answers your needs.

  3. #3
    Just Joined!
    Join Date
    Mar 2008
    Posts
    4

    kind of solved

    Thanks for answering.

    First, I haven't been able to create a symbolic link. Being in root, I tried:

    #ln -s ./html/files files

    That created a link inside the existing folder (1) targeting at the files folder (2) inside html. It didn't solved the problem. It seems that I can't create a link named files if there's already a folder with that name. It looke like: root/files/files, and it can't be accessed. Then, I deleted the files folder 1 and the link just created, and I tried again:

    #ln -s ./html/files files

    Apparently it did it. It takes me to folder 2. However, when I try to download files, I get a "403 Forbidden error", although before I was able to access to files outside html. Besides, if I had just deleted the files folder 1, (without making the link), I would've gotten the same error. Apparently, without the files folder 1, files folder 2 is looked for.

    Next, I created another folder inside html and named it "uploaded", and configured drupal to upload files into this folder. That did it. It seems that drupal got confused with files folder 1, because SME server by default takes root/files to the folder outside html. I hope I won't have more problems; otherwise, I'll come back.

    Yersin.

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •