This is probably due to mod_dir issuing a subrequest for the directory index (ie.
You can try adding a negative lookahead to the regex to specifically exclude requests for
index.php. For example:
RedirectMatch 302 /(?!index\.php)(.+) instagram://user?username=$1
UPDATE: If you are now having a problem with
index.html (another possible directory index) then you can exclude this as well:
RedirectMatch 302 /(?!index\.php|index\.html)(.+) instagram://user?username=$1
Or disable directory indexes altogether and redirect everything (change
.*). For example:
RedirectMatch 302 /(.*) instagram://user?username=$1
However, this will redirect even when no username is given.
To avoid conflicts with your existing site, it would probably be preferable to make this "instagram" URL unique, so it doesn't override your existing URLs. For example:
example.com/instagram/<username>. You could then simplify the above directive to:
RedirectMatch 302 /instagram/(.+) instagram://user?username=$1
Or, you could even reduce it to something like
example.com/i/<username> - if that is still unique.
RedirectMatch 302 /i/(.+) instagram://user?username=$1