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
-
#1 rankings on both HTTP and HTTPS vs duplicate content
We're planning a full migrate to HTTPS for our website which is accessible today by both **www.**website.com, **http://**www.website.com as well as **https://**www.website.com. After the migrate the website will only be accessible by https requests and every other request (Ex. www or http) will be redirected to the same page but in HTTPS by 301 redirects. We've taken a lot of precautions like fixing all the internal links to HTTPS instead of HTTP etc. My questions is: What happened to your rankings for HTTP after making a full migrate to HTTPS?
Technical SEO | | OliviaStokholm0 -
What are the SEO considerations when migrating a whole site from http to https
Hi Mozzers, I'm in the process of migrating a whole site, which has excellent rankings built through ongoing SEO over the years, from http to https. What is the safest way of doing this, while maintaining rankings? I'm assuming 301 redirect of every page from http to https? Thanks!
Technical SEO | | A_Q1 -
Http to https - Copy Disavow?
If the switch is made from http to https (with 301 redirects from http to https) should the disavow file be copied over in GWT so it is also uploaded against the https as well as the http version?
Technical SEO | | twitime0 -
302 Redirect from HTTP to HTTPS
Hi Guys One of our client's website is having 586 linking unique domains to http://www.XYZ.com.au (to home page only). They have migrated their site to https://www.XYZ.com.au so all of their site pages are on HTTPS now instead of HTTP. The HTTP version of the home page is 302 redirected to HTTPS therefore we think they are not getting all the link juice of 586 linking domains and would like to recommend to change their 302 to 301. However we have not seen any ranking drop due to this migration and redirect in place. The new HTTPS site/redirect is live from last 2 months now. So not sure its worth recommending 301 or not? Does this mean Google is picking up this 302 redirect as normal and attributing all link value to HTTPS version? Please can anyone share their thoughts on recent Google interpretation of 302 from HTTP to HTTPS? Thanks
Technical SEO | | JamesDixon700 -
Handling 301s: Multiple pages to a single page (consolidation)
Been scouring the interwebs and haven't found much information on redirecting two serparate pages to a single new page. Here is what it boils down to: Let's say a website has two pages, both with good page authority of products that are becoming fazed out. The products, Widget A and Widget B, are still popular search terms, but they are being combined into ONE product, Widget C. While Widget A and Widget B STILL have plenty to do with Widget C, Widget C is now the new page, the main focus page, and the page you want everyone to see and Google to recognize. Now, do I 301 Widget A and Widget B pages to Widget C, ALTHOUGH Widgets A and B previously had nothing to do with one another? (Remember, we want to try and keep some of that authority the two page have had.) OR do we keep Widget A and Widget B pages "alive", take them off the main navigation, and then put a "disclaimer" on the pages announcing they are now part of Widget C and link to Widget C? OR Should Widgets A and B page be canonicalized to Widget C? Again, keep in mind, widgets A and B previously were not similar, but NOW they are and result in Widget C. (If you are confused, we can provide a REAL work example of what we are talkinga about, but decided to not be specific to our industry for this.) Appreciate any and all thoughts on this.
Technical SEO | | JU19850 -
How do i properly combine these two schema's from schema.org
So we're redoing our reviews/testimonials page on our website right now and moving over to the schema.org format as described here: http://schema.org/Review But we would like to combine each of our reviews with a location for which it was reviewed using this: http://schema.org/LocalBusiness What i can't wrap my head around would be the correct syntax? is it just the first block and then the next block? or is there a way of putting the actual physical address within the review page itself? So is this the correct way to do a page full of reviews that are reviewing various physical locations? * <div< span="">itemprop="reviews" itemscope itemtype="http://schema.org/Review"></div<>* <span< span="">itemprop="name">Value purchase</span<> -* by <span< span="">itemprop="author">Lucas</span<>,* <meta< span="">itemprop="datePublished" content="2011-03-25">March 25, 2011</meta<>* <div< span="">itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating"></div<>* <meta< span="">itemprop="worstRating" content = "1"/></meta<>* <span< span="">itemprop="ratingValue">4</span<>/* <span< span="">itemprop="bestRating">5</span<>stars* <span< span="">itemprop="description">Great microwave for the price. It is small and</span<>* fits in my apartment. 1. <div< span="">itemscope itemtype="http://schema.org/LocalBusiness"></div<> 2. # <span< span="">itemprop="name">Beachwalk Beachwear & Giftware</span<> 3. <span< span="">itemprop="description"> A superb collection of fine gifts and clothing</span<> 4. to accent your stay in Mexico Beach. 5. <div< span="">itemprop="address" itemscope itemtype="http://schema.org/PostalAddress"></div<> 6. <span< span="">itemprop="streetAddress">3102 Highway 98</span<> 7. <span< span="">itemprop="addressLocality">Mexico Beach</span<>, 8. <span< span="">itemprop="addressRegion">FL</span<> 10. Phone: <span< span="">itemprop="telephone">850-648-4200</span<> <div< span="">itemprop="reviews" itemscope itemtype="http://schema.org/Review"></div<>* <span< span="">itemprop="name">Value purchase</span<> -* by <span< span="">itemprop="author">Lucas</span<>,* <meta< span="">itemprop="datePublished" content="2011-03-25">March 25, 2011</meta<>* <div< span="">itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating"></div<>* <meta< span="">itemprop="worstRating" content = "1"/></meta<>* <span< span="">itemprop="ratingValue">4</span<>/* <span< span="">itemprop="bestRating">5</span<>stars* <span< span="">itemprop="description">Great microwave for the price. It is small and</span<>* fits in my apartment. <div< span="">itemscope itemtype="http://schema.org/LocalBusiness"></div<> <span< span="">itemprop="name">Beachwalk Beachwear & Giftware</span<> <span< span="">itemprop="description"> A superb collection of fine gifts and clothing</span<> to accent your stay in Mexico Beach. <div< span="">itemprop="address" itemscope itemtype="http://schema.org/PostalAddress"></div<> <span< span="">itemprop="streetAddress">3102 Highway 98</span<> <span< span="">itemprop="addressLocality">Mexico Beach</span<>, <span< span="">itemprop="addressRegion">FL</span<> Phone: <span< span="">itemprop="telephone">850-648-4200</span<>
Technical SEO | | adriandg0 -
Video Link Bait - Protections, Formats, Methods
I wanted to find out if anyone could recommend the best technique for protecting a video on a website. We have been able to secure a private interview with one of the largest manufacturers in this customers industry. Unfortunately the interview was done impromptu with an iphone, but the recording is not too bad. The volume is low, but we will also type out the content of the interview on our blog, right beneath where the video is posted for viewing. We were hoping to only post this video on our blog, so that people within our industry will link to that page, increasing our link power. But we wanted to make sure that people couldn't steal the video and post it in other places to avoid giving us our link. What is the best method for accomplishing this? What video format would be ideal to hopefully accommodate windows, mac, IE, Firefox, Safari, mobile phones, ipads etc.? Are we on the right track on how to most effectively use this video for our own benefit?
Technical SEO | | JerDoggMckoy0 -
What's the best way to deal with an entire existing site moving from http to https?
I have a client that just switched their entire site from the standard unsecure (http) to secure (https) because of over-zealous compliance issues for protecting personal information in the health care realm. They currently have the server setup to 302 redirect from the http version of a URL to the https version. My first inclination was to have them simply update that to a 301 and be done with it, but I'd prefer not to have to 301 every URL on the site. I know that putting a rel="canonical" tag on every page that refers to the http version of the URL is a best practice (http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=139394), but should I leave the 302 redirects or update them to 301's. Something seems off to me about the search engines visiting an http page, getting 301 redirected to an https page and then being told by the canonical tag that it's actually the URL they were just 301 redirected from.
Technical SEO | | JasonCooper0