Search code examples
phpapache

Why Apache doesn't list "header.php" or all files which are begin by header in directory page on browsers?


Why doesn't Apache list "header.php" or any files that begin with "header" on the directory page in browsers?

This issue occurs in different browsers and folders.

This is occurring when we installed Apache via WAMP. We have also tried it via Laragon, and it lists them normally.

We can use and include the "header.php" file, but it's not visible in the browser.

We tried changing the path, and changing local server.

It also works online without any problems, so why not via wampserver?

Could someone please explain this?

enter image description here


Solution

  • Most likely the effect of the IndexIgnore directive,

    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. By default, the list contains . (the current directory).

    IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t

    HEADER*, on a OS with a case-insensitive file system, like Windows, would lead to header.php being ignored as well.