At first you have to understand what a web server is doing when requesting a directory instead of a specific page. Most servers will look if the directory contains specific files and will return the first that exists. If there is none of these files, a directory listing might be generated (if enabled) or an error message is returned (directory listings not allowed).
With Apache this is configured with the
mod_dir - directoryindex[
^] option.
To enable directory listings use the
mod_autoindex - Apache HTTP Server Version 2.4[
^] option and set
Options +Indexes
(e.g. in the htaccess file).
The
mod_alias - redirect[
^] you have tried is not working for files:
Quote:
The old URL-path is a case-sensitive (%-decoded) path beginning with a slash
I don't know what you really want to achieve. But if directory listings are enabled and you want to redirect from
index.php to the directory, just do it within that file by adding something like this to the header of the HTML output:
<meta http-equiv="refresh" content="0; url=/afolder/bfolder/" />
But note that the file
index.php must not be listed with the
directoryindex
option in this case.