Proper method of consolidating https to http?
-
A client has an application area of the site (a directory) that has a form and needs to be secured with ssl. The vast majority of the site is static, and does not need to be secured. We have experienced situations where a visitor navigates the site as https which then throws security errors. We want to keep static visitors on http; (and crawlers) and only have visits to the secure area display as ssl. How is this best accomplished?
Our developer wants to add a rule to the global configuration file in php that uses a 301 redirect to ensure static pages are accessed as http, and the secure directory is accessed as https. Is the the proper protocol? Are there any SEO considerations we should make?
Thanks.
-
Hi there,
I would agree with your developer in using 301 redirects to ensure all static pages resolve only to the HTTP version while the secure pages resolve only to HTTPS.
As for SEO, the search engines should follow these 301 redirects just fine, but it might also be a good idea to designate canonical URLs to tell the search engines only to index non-HTTPS pages just to be safe. The PHP code below automatically detects which version of the page is being accessed and automatically inserts a canonical tag to tell the search engines to only index the non-HTTPS versions.
$currenturl= $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
//Check if it is using the secure https port which is 443
if ($_SERVER["SERVER_PORT"] == “443″) {//connected to secure port, formulate the http canonical version
$canonicalversion=”http://”.$currenturl;//echo the canonical version to the HTML as link rel canonical tag
echo ‘’;
}
?>
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
-
Migrating website to new CMS and to https://
Hi, We are migrating an old website to a new one built in Wordpress soon. We also added an SSL to change to https:// Most of the url's stay the same. Can we just migrate from http to https on server level, and for the url's that do change just set a 301 redirect? Or are there other things we should take into account?
Technical SEO | | Mat_C0 -
Google Plus One button and https migration
I have a site that has gotten quite a few google +1's. I am currently migrating to https for the site and it seems I will lose all the +1's? Per the documentation it seems I can set the URL to the normal http://, but that would then allow ppl to continue +'ing the old url. Is there a way around this? Thanks!
Technical SEO | | plahpoy0 -
Some URLs were not accessible to Googlebot due to an HTTP status error.
Hello I'm a seo newbie and some help from the community here would be greatly appreciated. I have submitted the sitemap of my website in google webmasters tools and now I got this warning: "When we tested a sample of the URLs from your Sitemap, we found that some URLs were not accessible to Googlebot due to an HTTP status error. All accessible URLs will still be submitted." How do I fix this? What should I do? Many thanks in advance.
Technical SEO | | GoldenRanking140 -
Http and https issue in Google SERP
Hi, I've noticed that Google indexing some of my pages as regular http, like this: http://www.example.com/accounts/ and some pages are being indexed as https, like this: https://www.example.com/platforms/ When I've performed site audit check in various SEO tools I got something around +450 pages duplicated and showing me pairs of the same URL pages, one time with http and one time with https. In our site there is the possibility for people to register and and open an account, later on to login to our website with their login details. In our company I'm not the one that is responsible for the site's maintenance and I would like to know if this is an issue, and if this is an issue - to know what causing it and how to fix it so I'll be able to forward the solution to the person in charge. Additionally I would like to know in general, what is the real purpose of https vs. http and to know what is the preferred method that our website should use. Currently when URLs are typed manually to the address bar, all the URLs are loading fine - with or without https written at the start of each URL. I'm not allowed to expose our site's name, this is why I wrote example.com instead, I hope you can understand that. Thank you so much for your help and I'm looking forward reading your answers.
Technical SEO | | JonsonSwartz0 -
I've consolidated other domains to a single one with 301 redirects, yet the new domain authority in MOZ is much less that the redirected ones. Is that right?
I'm trying to increase the domain authority of my main site, so decided to consolidate other sites. One of the other sites has a much higher domain authority, but I don't know why after a 301 redirect, the new site's domain authority hasn't changed on over a month. Does MOZ take account of thes types of things?
Technical SEO | | bytecgroup2 -
Are robots.txt wildcards still valid? If so, what is the proper syntax for setting this up?
I've got several URL's that I need to disallow in my robots.txt file. For example, I've got several documents that I don't want indexed and filters that are getting flagged as duplicate content. Rather than typing in thousands of URL's I was hoping that wildcards were still valid.
Technical SEO | | mkhGT0 -
405 HTTP Status instead of 404
Hi We need to block some www1-pages from being indexed. Now IT has resolved this but pages like http://www1.swisscom.ch/fr/business/pme.html return a 405 status instead of a 404. The pages are currently still indexed in Google. Must the status be changed to 404 or should I just wait and see if Google de-indexes them anyhow?
Technical SEO | | zeepartner0 -
How do I properly use the canonical tag to avoid negative effect from having identical content on 2 url’s?
To illustrate… I have same website uploaded at 2 locations (url’s). Only the domain extensions are different. www.myexample.com
Technical SEO | | swiftseo
www.myexample.org The benefit is that I may run some promos on one location and not the other to help in product surveys/testing. The website content is 98% identical and I understand this content duplication may cause SEO problems. The domain I wish to use for rankings etc is www.myexample.com 1) How do I go about avoiding seo problem? Do I need to place the canonical tag at www.myexample.org ie 2) Do I also place the exact same tag at the .com location or not necessary there? Is there an alternative or more effective option to resolving the problem?0