I have a htdocs directory where I am serving a few Microsoft Word documents. When someone is editing a document, the name of the document changes to look like something like this: "~$my_document.doc" and also .tmp files are created that represent edits of the document until the document is closed.
So, I want Apache to not serve these files until the user is finished editing them. So, I want to hide files ending with .tmp extension at the same time that I am hiding files that start with "~$" .
So, can anyone help me enhance this Apache directive to accomplish this?
<Directory "C:/Apache2.2/htdocs">
<Files ~ "\.tmp$">
Order allow,deny
Deny from all
</Files>
.....
</Directory>
This is a regular expression trick that is beyond my ability right now.
Do another
<Files>
block with the expression^~\$
.Keep in mind that the original file doesn't disappear when the file's being edited - if that's a problem for what you're looking to do, then you'll need some more complex regex voodoo.
I don't have a system to test, but I would suppose you need to do something like this.
This should match either any file name that starts with a
~$
followed by anything, and any files that end in.tmp
.