Connection reset when trying to access / with a FallbackResource rule

I am having an issue where my site is working as intended for all urls except the base url of example.com/. When I try to access that in particular I get a connection reset.

I have reduced my site to extremely bare bones, and now consists of only a

.htaccess file:

FallbackResource /router.php

router.php: (simplified to a basic html page for debugging)

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Maintenance</title>
</head>
<body>
  <p>System Maintenance</p>
</body>
</html>

So going to example.com/moonmoon.php, example.com/index.php or example.com/anything the page will be served as normal. The FallbackResource is working so if the file is absent, I still get router.php.

but going to example.com/ gets a connection reset.

Unfortunately it is a managed host, and I do not have access to the logs.

Anyone know what is going on here?

Answer

Turns out all I needed to do is add a DirectoryIndex rule to the htaccess file and it started working as intended.

Thanks.

Attribution
Source : Link , Question Author : user348959 , Answer Author : user348959

Leave a Comment