Access files outside the document root using Apache

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

The document root for the website is similar to this:

/a/b/c/d/e/f/g/h/mywebsite.com (letters have their own names).

The file I need to read is here:

/a/b/c/myfile.txt

I tried symbolic links, but maybe made them wrong ... any ideas?

+8
linux ubuntu apache document-root
source share
1 answer

You can create a directory alias:

<VirtualHost....> ..... stuff ..... Alias /mydir /a/b/c </VirtualHost> 

then you can access the text file as follows:

 domain.com/mydir/myfile.txt 

Please note that this should happen in the central configuration file, not in the .htaccess file.

Symbols are also an option. Make sure you have

 Options +FollowSymlinks 

.

+12
source share

All Articles