Allow access to a hidden directory (.) in Apache
Asked Answered
D

1

6

I need to put something in a directory on my web server that starts with ., i.e. the path would be my.domain/.something/somefile.

However, it seems that my Apache configuration blocks all access to hidden directories.

How do I change the config so that access to this one particular directory is allowed?

Deventer answered 4/12, 2015 at 14:44 Comment(4)
This is one reason why I switched to nginx, way better and easier configuration. Try this answer maybe helps you serverfault.com/questions/245922/…Alidia
@sjagr .htaccess files are protected by a rule that matches .ht* in the default apache configuration. It does not affect directories starting with a dot.Alidia
It says in apache documentation that "The IndexIgnore directive adds to the list of files to hide when listing a directory. File is a shell-style wildcard expression or full filename. Multiple IndexIgnore directives add to the list, rather than replacing the list of ignored files.". Does this mean that IndexIgnore also makes all directories (and sub-directories) that match unaccessible or just makes them invisible to file listings?Deventer
It's specific to how they're indexed, not whether they can be accessed or not. In other words, this stuff is related to the question.Pitsaw
P
4

The default configuration from the apache.org distribution has no problem serving files from a .something subdirectory of the document root. You'd have to search your own logs and configuration for a problem.

Pitsaw answered 4/12, 2015 at 15:20 Comment(3)
You were right. There indeed was a configuration file set up by some previous admin of my server that prevented serving of hidden files and directories. I disabled it and now everything seems to work.Deventer
@Deventer Would be good to know what exactly the former admin configured. Was it IndexIgnore or something different?Esurient
2022: See https://mcmap.net/q/1913963/-how-to-configure-apache-to-view-hidden-filesMccowan

© 2022 - 2024 — McMap. All rights reserved.