How to resolve warning of pages with redirect chain when its your http:// to https://www.
-
how do I write a 301 redirect in the htaccess file so that http:// goes straight to https://www. Moz replyHey there!Thanks for reaching out to us!
-
Thanks for your response Nick, Great answer
Yes, I am using WordPress Cloudflare. I will get on to this soon and let you know how I get on.
-
Hi Rod,
From reading the title, are you saying you have tried to do this and it has caused redirect chain issues?
I don't suppose you're using Wordpress and/or a CDN? It's a common error I have seen with that CMS due to how Wordpress natively redirects some parts of the URL.
Anyway, here are a few stackoverflows with suitable code snippets:
https://stackoverflow.com/questions/13977851/htaccess-redirect-to-https-www
Note: You will need a wildcard SSL certificate or to generate two which cover non-www and www to ensure the directs work properly.
Good luck,
Nick
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
-
Duplicate pages with "/" and without "/"
I seem to have duplicate pages like the examples below: https://example.com https://example.com/ This is happening on 3 pages and I'm not sure why or how to fix it. The first (https://example.com) is what I want and is what I have all my canonicals set too, but that doesn't seem to be doing anything. I've also setup 301 redirects for each page with "/" to be redirected to the page without it. Doing this didn't seem to fix anything as when I use the (https://example.com/) URL it doesn't redirect to (https://example.com) like it's supposed to. This issue has been going on for some time, so any help would be much appreciated. I'm using Squarespace as the design/hosting site.
Technical SEO | | granitemountain0 -
Best Topography for eCommerce Site Product Pages (flat nav/off the root OR in products subfolder) ?
Hi Im SEO'ing a Shopify site (new/not yet live) at the moment and all the products are in a 'Products' subfolder along the lines of: domain.com/products/blue-widgets/ etc I understand that many ecommerce SEO's these days go 'Flat Navigation' with all products 'off the root' rather than in a sub folder. Then they communicate product & categories/departmental relationships via breadcrumbs & other internal linking etc In the case of a platform like Shopfy is this a good idea or is it best to leave 'as is' and the 'Products' subfolder is a perfectly good place for the product pages ? All Best Dan
Technical SEO | | Dan-Lawrence0 -
Redirect chains after a site migration
Hi A clients site was originally canonicalised to the www. from the non www versions Now its migrating to an international config of www.domain.com/uk and www.domain.com/us with the existing pages/urls (such as www.domain.com/pageA) 301'd to the new www.domain.com/uk/pageA for example Will this will create a 301 redirect chain due to the existence of the original canonicalised urls or is the way that works 'catch all' so to speak, and automatically update the canonical 301 redirects of the non www old architexcture url's to the new international architecture URL's ? I presume so but just want to check ? cheers dan
Technical SEO | | Dan-Lawrence0 -
Warnings for blocked by blocked by meta-robots/meta robots Nofollow...how to resolve?
Hello, I see hundreds of notices for blocked by meta-robots/meta robots nofollow and it appears it is linked to the comments on my site which I assume I would not want to be crawled. Is this the case and these notices are actually a positive thing? Please advise how to clear them up if these notices can be potentially harmful for my SEO. Thanks, Talia
Technical SEO | | M80Marketing0 -
My home page 301 redirects - is this an SEO problem
When ever a browser calls my site canineconcepts.co.uk, it is automatically 301 redirected to canineconcepts.co.uk/en I am not sure if I should be concerned about this from an SEO perspective or not. Any thoughts?
Technical SEO | | CanineConcepts0 -
Root domain not resolving to www. Duplicate content?
Hi, I'm working with a domain that stays on the root domain if the www is not included. But if the www is included, it stays with the www. LIke this: example.com
Technical SEO | | HardyIntl
or
www.example.com Of course, they are identical and both go to the same IP. Do search engines consider that to be duplicate content? thanks,
michael0 -
How to Redirect only specific pages to new domain
My HTACCESS FILE IS AS FOLLOWS: rewriteengine on
Technical SEO | | askthetrainer
rewritecond %{HTTP_HOST} ^mydomain.com$
rewriterule ^mydomain/(.*)$ "http://www.mydomain.com/$1" [R=301,L] #4d864805b49b5 I want to move ONLY specific pages from this domain to a new domain How do I edit my HTACCESS (which redirects http:// to www.) to move specific pages from old domain (which I have to delete) to new domain.... I.e. http://mydomaon.com/move.html needs to move to http://mynewdomain.com/move.html Where i can delete the original domains0 -
Backlinks pointing to the B page of an A/B test.
To rel-canonical or to 301, that is the question. We're frequently running an A/B split test on our home page to optimize conversion. As a result about 10,000 backlinks to our homepage point to the B page. (If we're running a test when a blog or newspaper checks us out, there's a 50% chance they're diverted to the B page. So when they copy our home page URL, they're unknowingly copying the B page link.) We can't contact all of these sites and ask for them to change their links. A lot of the links are from big organizations that aren't interested in tweaking the links of old articles. So should we rel-canonical or 301 the B page? We consistently use the same URL for our B page tests, so we'd only have to 'fix' one page. Thanks in advance!
Technical SEO | | JoeNYC0