WebSite X5Help Center

 
Anita B.
Anita B.
User

SSL Certificate redirection  en

Autor: Anita B.
Visitado 2245, Seguidores 1, Compartilhado 0  

Hi, I am having issues with redirecting http to https.  I did step 1 and changed the URL to https and uploaded the site overriding the files that were there.  If I type www.mysitename.com.au it goes to http. If I google my site name it turns up as https and goes to https. I set the redirect in my cpanel but found google doesn't like it when it tries to recrawl my website.

I have seen a post about adding a code to the site for the redirection but have no idea where I place this code. So my questions are:

1. Do I have to place a special code within my site so that if someone types www.mysitename.com.au into the URL it will redirect to https?

2.  If I do, what is the code and exactly how do I place it on my website?

Any help would be greatly appreciated.

Publicado em
11 RESPOSTAS
Andrzej K.
Andrzej K.
User

You need to add file .htaccess (if there is no file .htaccess) or add below lines to present file .htaccess:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

This file should be in the main catalog of website (the same catalog in which there is index.htm file).

Ler mais
Publicado em de Andrzej K.
Esahc ..
Esahc ..
Moderator

Anita, you will not see this htaccess file through the ftp built in to WX5. You will need filezilla (or similar).

Ler mais
Publicado em de Esahc ..
Anita B.
Anita B.
User
Autor

Thanks but I still don't know where to add this code.  Where do I go to add the code?  How does Filezilla help?  I am not sure where I go to add the code.

Thanks!

Ler mais
Publicado em de Anita B.
Anita B.
Anita B.
User
Autor

Do I select the home page properties in step 3 to add this code?

Ler mais
Publicado em de Anita B.
Andrzej K.
Andrzej K.
User

After sending your files on server (whatever by Website or by other programm ftp) you need to open ftp programm (for example FileZilla) and check if in the main catalog there is file .htaccess. If yes please copy it on hard disc, add above lines to it by Notepad or other text editor, save and send it in the place of the old one on server (by any ftp programm). If not, you need to creat a new file in any text editor, put above line, save with name .htaccess and send it on server (by any ftp programm).

Ler mais
Publicado em de Andrzej K.
Anita B.
Anita B.
User
Autor

I have done all the above and I still have a website that opens for http and https.  Any other suggestions as the .htaccess text file didn't not work with the code.

Ler mais
Publicado em de Anita B.
Andrzej K.
Andrzej K.
User

Maybe your hosting supplier doesn't accept .htaccess files? Check it. Please let us link to your website to see what is the problem and when open http and https.

Ler mais
Publicado em de Andrzej K.
Anita B.
Anita B.
User
Autor

The problem is if you type the www.mysitename.com.au you get the website (URL address with http) but it doesn't redirect to the https://www.mysitename.com.au website.  If you search using google or actually type the https:// in the URL it goes to the https site.  The issue is if you just type www.mysitename.com.au in the URL it doesn't redirect. 

Ler mais
Publicado em de Anita B.
Incomedia
Stefano G.
Incomedia

Hi Anita,

As mentioned by the other users and by Esahc, you would probably need to make use of an .htaccess file to get this to work properly.

This can be a troublesome task though if you're not really sure about how to get it to work.

I would suggest you contact your hosting's support, and they should be able to provide the support you need for getting the file to work correctly.

I'm sorry about not being able to help you out further with this, but since this is custom code which is not generated by the software, the Staff cannot offer support for it

Thank you

Stefano

Ler mais
Publicado em de Stefano G.
Andrzej K.
Andrzej K.
User

So you need my first advise - file .htaccess with below lines:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

for sure do it - check it on my test site www.ametal.pl

you put site name http://www.ametal.pl - it is changed into https://www.ametal.pl

It was done exactly I wrote with .htaccess file made in notepad and sent by filezilla ftp client.

Ler mais
Publicado em de Andrzej K.
Tomasz S.
Tomasz S.
User

Anita, I had the same problem. I suppose that you (same me, some minutes ago) have a problem how to do it in practise. Andrzej explane the problem correctly. You should open Windows notepad then copy and paste lines Andrzej.K wrote to opened notepad new file.

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Save this notepad file exactly as .htaccess but without extension .txt just .htaccess You need to copy this file using ftp protocol (any program which could copy your .htaccess file to the folder where all your website files are located) It is a folder on your serwer or serwer where your www files are located. I have made this and everything works correctly.

Ler mais
Publicado em de Tomasz S.