I have the default myIndex.php in a subfolder of public_html.
I added a file .htaccess in public_html.
I added DirectoryIndex /subfolder/myIndex.php in it.
myIndex.php contains links and includes. Includes seems to work but links dont: no images and no css but menu.php is included. Links in menu.php dont work either.
If I
change .htaccess to DirectoryIndex index.php,
create a file index.php in public_html,
and put a link to "./subfolder/myIndex.php" in it
everything works fine.
I dont understand what happens here.
DirectoryIndexdetermines what to do, when a client requests a directory. If you havethen exactly this script will be executed every time the client requests a directory, no matter where this directory is, e.g.
/anotherfolder/or/static/. But when you haveinstead, Apache looks for an
index.phpin the requested directory, e.g./anotherfolder/index.phpor/static/index.php.