SiteGround added the following rules at the end of the .htaccess on the server. I copied the same lines into my local .htaccess, so the two files are identical and git doesn’t find any conflict.
Problem is when I open the local copy of the website, I receive a blank error page.
Is there a way to put an IF statement, so that if the website is running on server, the lines get processed. If it is running on localhost, the lines are skipped?
You should remove the first line (AddHandler). This one is not specific to the redirect, but sets which PHP version to use (which does not make any sense for a simple redirect).
After that, the rule should work on your local dev host as well and be ignored there. The RewriteCond rules are basically if rules.