Accessing files outside the document root with Apache

前端 未结 1 681
耶瑟儿~
耶瑟儿~ 2021-01-11 23:26

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/

相关标签:
1条回答
  • 2021-01-11 23:56

    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.

    0 讨论(0)
提交回复
热议问题