I'm trying to redirect a website to a new domain name. The old website wasn't configured correctly and it has URLS that are BOTH http and https. So, half of the urls are https://example.com and the other half are http://example.com.
I didn't realize that the site had any https urls until I finished writing out all of the 301 redirects.
So, right now I have about 300 lines of Redirect 301 that I wrote like this:
# Redirect the posts
Redirect 301 /2016/5/page1/ https://NewUrl.com/page1/
They work when the url is http, but sometimes the URL that I 301'd is an https. When the url is https, the Redirect 301 does not work.
I am hoping that there is some way to fix this without having to rewrite 300 lines.
I've tried to clarify this, but in case it still isn't clear here is another attempt: OLD website has BOTH http and https URLS. New site has ONLY https. I wrote lots of Redirect 301 commands to send the OLD website to the NEW site WITHOUT realizing the OLD site had BOTH http and https links. How do I make sure the old website's 301 urls direct http AND https urls to my new site that only uses https.
To the user who said this was already asked, the suggested duplicate question had nothing to do with 301'ing both http and https from the former blog. This blog has former urls that are http and https indexed and with backlinks. I need both https and https to be forwarded to the new url which is ONLY using https