Redirect / /dali
Ordinarily, this directive would result in a redirect loop*1 for URLs other than
/api/<something> (since the mod_rewrite directive that follows takes priority), which leads me to think you don't have
.htaccess overrides enabled to begin with (ie.
.htaccess is not enabled)?
(*1 Unless perhaps you have another
.htaccess file in a subdirectory that somehow prevents this redirect-loop, or perhaps the
/dali subdirectory is Alias'd to a different part of the filesystem so the parent
.htaccess file is not reprocessed? Or something else?!)
.htaccess overrides, you need to set the appropriate
AllowOverride directive in your server config (for the required directory). For example:
The "sandbox" tool you link to would seem to be incorrectly handling that
Redirect directive and its prefix-matching behaviour*2. Also, it only makes a single pass through the code - it doesn't simulate the redirect, so "redirect-loops" are not detected.
Redirect directive is prefix-matching. eg.
Redirect / /dali matches any URL that simply starts
/ - which naturally matches everything. However the "mwl htaccess tester" appears to treat this
Redirect directive as an exact match and only matches
/ exactly, ie. the document root - this is incorrect.)
RewriteRule directive actually looks OK, except that it possibly matches too much, since it will also match
/api/s/o/m/e/t/h/i/n/g - is that the intention?