12

I have a project setup and i'm trying to access a file from a temp folder on the server.

The document root for the website is similar to this:

/a/b/c/d/e/f/g/h/mywebsite.com (of the letters have proper names).

The file I need to read lives here:

/a/b/c/myfile.txt

I've tried symbolic links but may have done them wrong... any ideas?

diggersworld
  • 12,770
  • 24
  • 84
  • 119

1 Answers1

18

You can create a directory alias:

<VirtualHost....>

..... stuff .....

Alias /mydir /a/b/c

</VirtualHost>

then you could access the text file like so:

domain.com/mydir/myfile.txt

Note that this needs to take place in the central configuration file, not a .htaccess file.

Symlinks are an option too. Make sure you have

Options +FollowSymlinks

turned on.

Pekka
  • 442,112
  • 142
  • 972
  • 1,088
  • 7
    Can anyone be more specific about this? I have a folder in another drive which I want to access. Where do I paste that block of code? – navand Jul 08 '11 at 16:53
  • 1
    This doesn't seem to work at all. Even after updating my main config file and restarting, Apache still returns "No Such Resource" page. – Cerin Sep 02 '22 at 01:35