SEO best practice : HTTP to HTTPS
-
What's the best practice to switch from an all HTTP site to an all HTTPS site ?
No changes to the site structure, just a full site switch to SSL.
Right now, the site is reachable with HTTP and with HTTPS.http://crocodesign.be --> https://crocodesign.be
http://www.crocodesign.be --> https://crocodesign.be
https://www.crocodesign.be --> https://crocodesign.beCMS : Wordpress 3.9
Server type : Apache
Preferred method : .htaccess -
I wonder why Google's PhD engineers didn't post detailed info about this?.... But, I can probably understand it better from the Moz blog.
They also should have warned people that it would tank their adsense earnings.
-
We'll also be posting more info about this on the Moz blog later this month.
-
Oh ok...
This line ensures its a 301:
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
-
@Rafi : I want to explicity state in the .htaccess rule that a 301 must be used.
-
You can use any of the HTTP header checkers available online for the purpose or a desktop tool like Screaming Frog SEO Spider can also give you the HTTP header status codes for any URL.
Best regards,
Devanur Rafi
-
Thank you for your reply @TomRoberts
How can I make sure it's a 301 permanent redirect ? -
The above redirect structure you've proposed would work great. You're ensuring only one homepage version exists, making it the canonical, and all variations (which may also have previous links going to them and SEO value) are being redirected to pass on to the canonical version.
You can use your .htaccess file to force http to https by adding the following code:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]The first line turns on redirection capabilities. The second line checks to make sure the connection is not already https. The third rule will redirect users from their original location, to the same location but using HTTPS.
And also, in case you want to know how to make sure that the www. version of your site redirects to the non-www version, the code would be:
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^www.(.)$ [NC]
RewriteRule ^(.)$ https://%1/$1 [R=301,L]Hope this helps
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Ajax, SEO and Angular
Hi all! We have a platform which includes a housing area which is created by ajax and angular. You can see a sample here:
Technical SEO | | Eurasmus.com
eurasmus.com/en/erasmus-antwerp/student-room-accommodation It has a static version under which shows the first 18 rooms, the rest are generated by angular.
Also this static version has a dynamic text with around 400 characters. Is this the right procedure?
How would you suggest to do it?0 -
Angular seo
Hi, how to do seo with angular ? is there an easy way to make google crawl your website healthy?
Technical SEO | | bigrat950 -
HTTP & HTTPS
what is best recommended when some of the pages on site goes from HTTP to HTTPS: 301 redirection or 302 redirection?
Technical SEO | | JonsonSwartz
and why? thank you I was asked to elaborate so: on my website I have open account pages. users are asked to fill the details. those page are secured and are HTTPS. the problem is that the whole website turned to HTTPS so they redirected most of the pages from HTTPS to HTTP.
the secured pages are redirected from HTTP to HTTPS. I wanted to check if it's correct and what is the best redirection way (301 or 302)0 -
SEO implications of network outage
Hi, Our bandwidth provider has informed us of a forthcoming network outage this weekend, the net result being that around 20 websites will be unreachable for a total of about 1 hour inside a predetermined 3 hour window.In an ideal world we would like to provide a holding page or be able to respond with a "503 Service Temporarily Unavailable" HTTP code, however the complete absence of connectivity means we'll be unable to do this.Does anyone have any ideas about the SEO implications of this kind of downtime? It would be useful to know if there are any actions we can take prior to the outage that could mitigate the impact. We've considered repointing the DNS to other servers, but it's only something we'll do if the negative impact of not doing it is too great.Thanks in advance!
Technical SEO | | Dave3920 -
Types of SEO Help
I have a web site that is going well but I think it could be better as far as usability and design. Also, I am sure an SEO professional would have some things to do to optimize. It seems though, that all the SEO companies either want to have along term contract or they don't work with my technology. Does anyone know of a company that would take my Visual Studio/C# project and tweak it for usability, design and SEO features for an hourly or set price?
Technical SEO | | Banknotes0 -
Auto-loading content via AJAX - best practices
We have an ecommerce website and I'm looking at replacing the pagination on our category pages with functionality that auto-loads the products as the user scrolls. There are a number of big websites that do this - MyFonts and Kickstarter are two that spring to mind. Obviously if we are loading the content in via AJAX then search engine spiders aren't going to be able to crawl our categories in the same way they can now. I'm wondering what the best way to get around this is. Some ideas that spring to mind are: detect the user agent and if the visitor is a spider, show them the old-style pagination instead of the AJAX version make sure we submit an updated Google sitemap every day (I'm not sure if this a reasonable substitute for Google being able to properly crawl our site) Are there any best practices surrounding this approach to pagination? Surely the bigger sites that do this must have had to deal with these issues? Any advice would be much appreciated!
Technical SEO | | paul.younghusband0 -
Merging several sites into one - best practice
I had 2 sites on the web (www.physicseditor.de, www.texutrepacker.com) and decided to move them all under one single domain (www.codeandweb.com) Both sites were ranking very good for several keywords. I not redirected the most important pages from the old domains with a 301 redirect to the new subpages (www.texturepacker.com => www.codeandweb.com/texturepacker) Google still delivers the old domains but the redirect take people directly to the new content. I've already submitted the new site map to google webmaster tools. Pages are already in the index but do not really show up in the search results. How long does it take until google accepts the new domain and delivers the new content in the search results? Was it ok what I did? Or is there some room for improvement? SeoMoz will of course not find any information about the new page since it is not yet directly linked in google. But I can't get ranking information for the "old" pages since SeoMoz tells me that it can't crawl the old domains....
Technical SEO | | gossi740 -
What is SEO impact of redirecting from domain to https appspot domain ?
Our site is hosted on google and is fully https. But since google's limitation is that all https needs to be on the appspot domain, we are redirecting users from our website to the appspot domain. What is the impact of this on SEO?
Technical SEO | | incandescent0