Score:0

using external disc for media files with RewriteRule

nl flag

My apache DocumentRoot folder is $HOME/MyProject/src. Large external disc is mounted on a server on /storage path.

I have a bunch of rewrite rules set on in apache .conf. For example:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/api/media/(.*) /data/$1 [L]

With the new external disc in place, rewrite rule should point to actual absolute path on /storage/myproject/data/$1, which is not in the DocumentRoot path.

I want to use the storage space of external disc for media files. I cannot use the default disc where source code is, because it is too small. What is my best option? Surely this doesn't mean moving source and DocumentRoot to slow HDD external storage.

djdomi avatar
za flag
and why not using a bind mount?
potato avatar
nl flag
thanks. first time bind mount. works great
djdomi avatar
za flag
so already solved?
potato avatar
nl flag
yes. but used symlinks at the end
djdomi avatar
za flag
`mount --bind /from /to` should not be sich hard?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.