I spent about 20 minutes wrapping my head around this, and finally came to a solution but did not know why it worked. The important lines (as it relates to this question) in the apache configuration file looked like this:
RewriteEngine On
RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule ^ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^$ /abc [L]
When I tried accessing http://example.com, the last rewriterule is skipped but what I do not understand is how is nothing a directory?
Based on the last three items from the way I see it, I'm checking to see if I'm requesting a file or a folder, and if not, then redirect nothing (aka the default page) to /abc.
It turns out here that RewriteCond %{REQUEST_FILENAME} !-d
returns false because when I remove it and try again using the configuration shown below:
RewriteEngine On
RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule ^ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^$ /abc [L]
the redirection then works.
Is there a reason as to why "nothing" counts as a directory? I don't want to fall into any more illogical traps like this as I update my website.
/