PHP redirect to HTTPS if page is
<p>I need a PHP if/else statement that if the sign-in.php or register.php page is access over HTTP I would like to redirect to HTTPS else if any other page is accessed over HTTPS redirect to HTTP plus have any query string appended for example if a user tries to access a restricted page (<a href="http://domain.com/my-account.php" rel="nofollow">http://domain.com/my-account.php</a>) the site redirects the user to <a href="http://domain.com/sign-in.php?redirect=my-account" rel="nofollow">http://domain.com/sign-in.php?redirect=my-account</a> however, I would like the page to redirect to <a href="https://domain.com/sign-in.php?redirect=my-account" rel="nofollow">https://domain.com/sign-in.php?redirect=my-account</a>.</p>

<p>I know I could simply change the header redirects to include https instead of http but users may type <a href="http://domain.com/sign-in.php?redirect=my-account" rel="nofollow">http://domain.com/sign-in.php?redirect=my-account</a> so just need to ensure if this happens sign in (or others) happen over https.</p>

<p>Any help is appreciated</p>
