After a lot of head-scratching, I finally found the cause of this behaviour. The problem persisted even after a complete re-install of OSTicket including DB files. This suggested it was my hosting setup rather than OSTicket.
I installed on https://www.mydomain.com/support which also had a subdomain created https://support.mydomain.com
The main domain mydomain.com had a wordpress install. As we know, wordpress is very aggressive with its .htaccess rules, taking any URLs with /support and re-writing them to a 404, or depending on your setup, re-directing to index.php. In my case, all requests for /login.php were being redirected to /index.php so the login page was never appearing.
The solution was to create new rules in the .htaccess file in the root of my site, placing them before the Wordpress rules:
#Rules for /support sub folder
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/support/(.*)$ [OR]
RewriteRule ^.*$ - [L]
</IfModule>
#end
Next, I created a .htaccess file in the /support folder like so:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /support/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
</IfModule>
My next problem was that when I followed the login link, I got a 422 error. I have no idea why OSTicket generates this, but the code in login.php is:
// Browsers shouldn't suggest saving that username/password
// Http::response(422);
I just commented out the second line, as others have suggested on this forum.
I now have a working OSTicket install.