Redirects when going from HTTP to HTTPS


This week I intend to acquire an SSL license, and I am quite respected for not knowing exactly what the process is. I have already asked my hosting provider with whom I have also hired the domain and I just have nothing clear about the process to follow. Once you make the switch to HTTPS,

Would I have to add some code in the file .htaccess so that all the URLs that point to HTTP are redirected to HTTPS?

Would this affect the indexing of the pages?

asked by JetLagFox 19.06.2017 в 20:16

2 answers


One thing you have to look at is whether it's a wildcard certificate (or wildcard ) or not, that is, if it allows you to have several domains / subdomains under the same certificate and which domains are going to be included in the SSL certificate.

For example, I have a certificate that covers up to 5 domains, so to "save domains" what I do is that I only include the link but do not link (with www. ).

That I get by putting the following in the .htaccess (I have in the mydomain folder):

Options +FollowSymLinks -MultiViews
# Activar mod_rewrite
RewriteEngine On
RewriteBase /midominio/

# quitar el www y redirigir a https
RewriteCond %{THE_REQUEST} \s/+midominio/(\S*)\s [NC]
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^{REQUEST_URI} [R=301,NE,L]  

On whether it affects the indexing of pages, yes and no. The search engines will have your version http:// indexed, but since you have a redirection of http to https your users will not notice any problem, and the next time your website is indexed, as you have put a redirection permanent (301), the search engine will index the page https correctly.

answered by 19.06.2017 в 21:09

If you are using Apache as a Web server you should have the Virtual-Host or whatever you do for the HTTPS (which will already be installed by the hosting people I suppose) and add a redirect so that each http request on your site is go back HTTPS. If you are using a CMS (or blog engine, sales engine, management) you should configure it so that from that moment generate the correct links.

As for the indexing, I do not think it will cause an impact if you have a valid certificate.

answered by 19.06.2017 в 20:24