I'm running apache in a linux environment. I've to serve files whose directory structure have "/." in it. Now, apache by default won't allow files with /. To remove the constraint, I've included the following entry in httpd conf.
But,this opens up all hidden directories under apache root. I'm trying to use a directory pattern so that it'll only allow files under this directory. For e.g. the directory path always start with /content/. The occurrence of /. can be anywhere. For e.g.
<DirectoryMatch "^.|/.">
Order allow,deny
Allow from all
</DirectoryMatch>
As you can see, I'm trying to create a pattern where the rule would allow directories starting with "/content" and can having "/." in its path.
Just wondering if it's possible to have a rule like this in option.
/content/url/test/.NET/sample/abc.html
/content/xyz/.BETA/sample/test.html
1 Answer
I've never tried that but you need to use
DocumentRoot
In apaches virtualhost config (in sites-enabled, or httpd.conf) file you need to follow this entry:
/content/url/test/.NET/sample/abc.html
/content/xyz/.BETA/sample/test.html
<virtualhost:*80>
ServerAdmin whatever@whatever
DocumentRoot {your-desired-directory {/root/file-path"/content"}
</virtualhost>
if you need to add / just create another entry for
<virtualhost:*80>
ServerAdmin whatever@whatever
DocumentRoot {your-desired-directory {/root/file-path"/"}
</virtualhost>
DocumentRootafter Googling for it