I have a very simple custom block/form that takes a user id and jumps to their profile page. The form submitForm has this:
$uid = $form_state->getValue('uid');
$path = '/user/' . $uid;
$response = new RedirectResponse(Url::fromUserInput($path)->toString());
$response->send();
This works as expected on my local dev system and on our staging server. For some reason, it does not work on the production site (different server but same configuration as the staging server, afaik).
There are no errors. The page does do a page load but stays on the same page.
I have added a log point to capture the response object. It is identical on both the prod site and the staging site.
The only thing I have seen in the past which appears similar to this (a page load with no errors but simply fails to do anything) is from Apache mod_security. Hosting company assures me it is not mod_security.
Any thoughts on something which could cause this or how to further debug the issue?