Hi,
I found this code in phpbuilder forum and it worked perfectly in redirecting http:// to https://
if($HTTPS != 'on') {
But i get a weird problem.
http://mysite.com/
is redirected to
https://mysite.com//
......... ie., with two slashes at the end. ...............
Pl let me know how to correct this. .htaccess redirection is very slow.
.htaccess, should be a faster better option, it takes pace before a file has to go through the php engine. As to the slash, theres one added in the code, so why not just remove it?
Thanks Dagon, it worked.
I removed slash from the code. I have no idea why they added the extra slash in the code. And previously i used .htaccess and it took a long time for the site to load and so i looked for the alternatives.
You helped me thanks. Issue resolved 🙂