Forcing Entire site to HTTPS
-
We have a Wordpress site and hope to force everything to HTTPS.
- We change the site name (in wordpress settings) to https://mydomain.com
- In the htaccess code = http://moz.com/blog/htaccess-file-snippets-for-seos
-
Ensure we are using HTTPS version of the site.
- RewriteCond %{HTTPS} !on
- RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
but some blogs http://stackoverflow.com/questions/19168489/https-force-redirect-not-working-in-wordpress say
- RewriteCond %{HTTPS} off
- RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Which one is right?
and are we missing anything?
-
No it isn't. As I said -
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]This is saying that the condition is off - so non HTTPS URL calls then have the rewrite rule to switch to HTTPS.
-
Thanks for the reply Mick,
so if we are implementing HTTPS for the first time,
"RewriteCond %{HTTPS} on " is the right rule, right?
Thanks in advance for your time
-
It looks like you should be going for
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]This is saying that the condition is off - so non HTTPS URL calls then have the rewrite rule to switch to HTTPS
RewriteCond %{HTTPS} on - is looking for HTTPS URL calls, so the opposite.
Test it and see what happens. You can always restore your backup .htaccess if you hit problems. Please be aware that your server set-up may mean this doesn't work and you'll have to delve deeper.
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
-
A semi client of mine reached out to me recently that another site scraped his whole site and traffic dropped significantly.
Someone that reaches out to me on occasion for help but is mostly an SEO DIYer recently had his site copied completely and his traffic dropped significantly immediately after. I have never had a client experience this in the past. Does anyone have suggestions or expertise on this? See his question and what he has done below. Jeremy This site scraped my credit site. Its appearance coincides with a dramatic sitewide decrease in Google traffic.I submitted a takedown request by paying this company $200. No results yet. My hosting company also placed blocks on the site HTML which pings my server for CSS and picture files. My Google Webmaster tools account shows inbound links coming from the copycat. Is there something more I should be doing? Copy Site: http://masqueros.com/Real Site: https://www.savvyoncredit.com/
White Hat / Black Hat SEO | | jeremyskillings0 -
Is it worth disavowing entire affiliate network?
Question for the pro's (all comments greatly appreciated) and it's doing my head in atmo. Recently, we received a temporary algorithmic penalty on one of our pages, which was originally ranking 12th, now 50+. We found out an affiliate put a site-wide link to our site, using the affiliate ID blablabla. I have taken a look at the exact link and checked the status codes on it, seems as if the link uses a 302 to our page. However, yes, you can argue that 302's d on't pass link juice, but I do believe that if a 302 remains in place for a while - Google will treat it as a 301. My question is: considering that affiliate links are causing us problems, is it worth disavowing the ENTIRE affiliate network? - we have over 100,00 links coming from them, all of which are targeting different pages and using different affiliate tracking ID's. What do you think - I don't want to disavow the site then realise it was actually some-what helping the site.
White Hat / Black Hat SEO | | Brett-S0 -
Different site behind the flag
Hello, I am in a very complicated situation. I have a site in Itaian which is targeted in Italy by webmaster tools so the majority of the organic traffic comes from there and everything is fine. However this site got a link from a major international site. So now I get traffic from all over the world but I can't take advantage of it. From the Italian traffic I get from this site I see high pageviews numbers and many minutes in average visitor time. The problem in this situation is that for many reasons this website cannot be translated so I can put many language choices in this site. I want to ask, If I put, let's say an English flag in top of my site, that will indicate the English language, but instead of the user to see an English version of the site he/she will be redirected(no follow link) to another site of the same content in English, will this violate any of Google's guideline or hurt the seo of the original site? Thank you all!
White Hat / Black Hat SEO | | Tz_Seo0 -
International web site - duplicate content?
I am looking at a site offering different language options via a javascript drop down chooser. Will google flag this as duplicate content? Should I recommend the purchase of individual domains for each country? i.e. .uk
White Hat / Black Hat SEO | | bakergraphix_yahoo.com1 -
Tags on WordPress Sites, Good or bad?
My main concern is about the entire tags strategy. The whole concept has really been first seen by myself on WordPress which seems to be bringing positive results to these sites and now there are even plugins that auto generate tags. Can someone detail more about the pros and cons of tags? I was under the impression that google does not want 1000's of pages auto generated just because of a simple tag keyword, and then show relevant content to that specific tag. Usually these are just like search results pages... how are tag pages beneficial? Is there something going on behind the scenes with wordpress tags that actually bring benefits to these wp blogs? Setting a custom coded tag feature on a custom site just seems to create numerous spammy pages. I understand these pages may be good from a user perspective, but what about from an SEO perspective and getting indexed and driving traffic... Indexed and driving traffic is my main concern here, so as a recap I'd like to understand the pros and cons about tags on wp vs custom coded sites, and the correct way to set these up for SEO purposes.
White Hat / Black Hat SEO | | WebServiceConsulting.com1 -
Build Backlinks on this site? - Advice Please
Hello, I am trying to build some backlinks to my E-Commerce site and was wondering how you all view sites like this: http://www.bookmark4you.com/ If I were to put a listing for my company/site on that site, would that be considered a good backlink or a bad backlink (in terms of Google's guidelines)... There are a bunch of sites like these, online directory or bookmark sites, and i was wondering what the general opinion is on using them for backlinking purposes. Any help or advice would be greatly appreciated. THANKS!!
White Hat / Black Hat SEO | | Prime850 -
Switching existing website to a Wordpress Site and afraid of losing top spot
I am going to be switching my current site from a standard html site to a wordpress site. I'm kind of paranoid of losing my top spot for the keyterms. If I keep the content the same, and keep the same amount of image alt tags, the same anchor text etc, nothing should change right? Grateful for any advice. Thanks Will
White Hat / Black Hat SEO | | willie790