I had a SSL certificate installed on my website yesterday and want to force all traffic to use https.
The server is a litespeed on a Cloud hosting account. I’ve spent hours on the phone with the hosting company with them finally saying that I would need to do scripting to get this to happen.
The suggest I use a .htaccess file which I have uploaded with the code suggested by “Whynopadlock”
I did that and when I try to access the page I get the warning that the page can’t be opened. Possible reason is that a page is trying to redirect that is trying to redirect opening the original page.
I’ve tried the original code and it passes on that site, and doesn’t break the site. Indicating that everything should work. And it doesn’t break anything. But testing on my windows browsers brings up the http page
I see the message, Not sure why it is happening.
Who is your hosting company?
Do you have anything else in the htaccess file?
Do you have any other redirects (maybe a cPanel entry)?
I looked at their support area, and the code should work. I did notice your home page is getting errors on the browser console. Now that shouldn’t have any effect on the redirects.
ERR_TOO_MANY_REDIRECTS is likely due to an infinite redirect loop. Now since you have no other redirects, and the one I gave you works. I would go to your hosting support and either chat with them or cut a ticket.
Thanks for the help. I’ll see what I can do with respect to contacting them and sorting it out. I was on the phone with them for hours yesterday for them to finally say that redirects were a scripting job and they weren’t responsible for that.
I can tell you for sure the script I listed above works 100%. It’s listed in multiple web hosting knowledge bases. It’s completely generic, notice no mention of your URL.
It may well be a problem with your hosting company, in spite of what their support representative initially told you. Yesterday I noticed that my own site suddenly stopped working and was giving me a “Too many redirects error”, even though it had been working flawlessly for a few weeks (I’ve just made the move to SSL).
I contacted the hosting company and they initially told me that they fixed the problem. But then it only lasted 10 minutes before it happened again. This cycle kept being repeated for a couple of hours, with repeated assurances that they’d fixed the issue, until finally it was solved on their end. They never did tell me what the issue was, and why my site started spontaneously throwing up such errors.
I’ve had the help of a fellow that does this stuff for a living, and every bit of code we’ve tried has either broken the site, or doesn’t do the job. He’s going to be calling Netregistry to find out what is happening on their end, and if they have a prefered method and syntax of redirect, as all the usual methods don’t work.