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.
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
-
Dodgy links across top ranking sites in a certain industry - Could this be negative link building?
Hi, I've noticed repeated low value / high spam backlinks directing to a site that I manage, and despite disavowing, new links showing similar anchor text keep appearing. See sample in the table below: <colgroup><col width="514"> <col width="407"> <col width="364"></colgroup>
White Hat / Black Hat SEO | | Alexanders
| biz.mfso.info/files/images/vertical-blinds-for-bifold-doors.html | | Get free high quality HD wallpapers vertical blinds for bifold doors |
| nmr.mfso.info/files/images/mould-on-vertical-blinds.html | | Get free high quality HD wallpapers mould on vertical blinds |
| nmr.mfso.info/files/images/install-vertical-blinds.html | | Get free high quality HD wallpapers install vertical blinds |
| nmr.mfso.info/files/images/cutting-vertical-blinds.html | | Get free high quality HD wallpapers cutting vertical blinds |
| rre.uere.info/files/images/high-quality-vertical-blinds.html | HD wallpapers high quality vertical blinds rre.uere.info | Get free high quality HD wallpapers high quality vertical blinds |
| dig.uere.info/files/images/mould-on-vertical-blinds.html | HD wallpapers mould on vertical blinds dig.uere.info | Get free high quality HD wallpapers mould on vertical blinds |
| dig.uere.info/files/images/mould-on-vertical-blinds.html | HD wallpapers mould on vertical blinds dig.uere.info | Get free high quality HD wallpapers mould on vertical blinds |
| hja.uere.info/files/images/cost-vertical-blinds.html | HD wallpapers cost vertical blinds hja.uere.info | Get free high quality HD wallpapers cost vertical blinds | I also looked across 5 high ranking sites in the same industry and noticed they too have these 'dodgy' links in their backlink profiles. Could this be negative link building? If so, does anyone know a way to trace it or get it stop?0 -
Ecommerce sites we own have similar products, is this OK?
Hello, In one of our niches, we have a big site with all products and a couple more sites that are smaller niches of the same niche. The product descriptions are different with different product names. Is this OK. We've got one big site and 2 smaller subsides in different niches that cross over with the big site. Let me know if Google is OK with this. We will have a separate blog for each with completely different content. There's not really duplicate content issues and although only the big site has a blog right now, the small ones eventually will have their own unique blog. Is this OK in Google's eyes now and in the future? What can we do to ensure we are OK? Thank you.
White Hat / Black Hat SEO | | BobGW1 -
Blocking entire country?
Hi folks, We have a webiste and we see that large majority of attacks are from China, so we want to block China IP addresses (we have no customers from China). My question is: will we get penalized by Google or other search engines? Regards, Nenad
White Hat / Black Hat SEO | | Uniline0 -
Is guest posting good for main link-building tactic for eCommerce site
Hello, Is guest posting going to be devalued? We've been offering a guest post with one link in the body pointing towards one of our articles, and one home page link in the bio. We're looking at doing this as the main link building strategy. Is this still a good idea now and in the future? Thanks!
White Hat / Black Hat SEO | | BobGW0 -
Why is this site performing so well in the SERP's and getting high traffic volume for no apparent reason!
The site is https://virtualaccountant.ie/ It's a really small site They have only about 7 back links, They don't blog They don't have a PPC campaign They don't stand out from the crowd in terms of product or services offered So why are they succeeding in topping the SERP's for difficult to rank for accounting keywords such as accountant and online accounts. What are they doing better than everyone else, or have they discovered a way to cheat Google, and worse still - ME!
White Hat / Black Hat SEO | | PeterConnor0 -
Multiple Versions of Mobile Site
Hey Guys, We have recently finished the latest version of our mobile site which means currently we have 2 mobile sites. Depending on what device and Os will depend on which site you will be presented with.
White Hat / Black Hat SEO | | seekjobs
e.g.
iPhone 3 or 4 users on iOS4 will get version 1 of our mobile site
iPhone 5 users on iOS5 will get the new version (version 2) of our mobile site. Our old mobile site is currently indexed in Google and performing pretty well.
Since the launch of the second mobile site we have not see any major changes to our visibility in Google and so was curious My main concern here is duplicate content so I am curious can Google detect that we have 2 mobile site that we serve depending on device? And if Google can detect this, why has our sites not been penalized! Thanks, LW I know the first thing that comes to your mind is Duplicate content0 -
Is this a 'real site' or a spam site for backlinks
I have been asked what type of site this is? What kind of page is this? [http://www.gotocostarica.com/](http://www.gotocostarica.com/) In my opinion it is site put up to create back links and should be avoided (especially in the light of the new Penguin and Panda updates coming). But I don't want to give wrong advice. What are your opinions?
White Hat / Black Hat SEO | | Llanero0 -
Will the links coming from an article in certain BLOG / NEWS SITE become a GOOD BackLink?
Such as, if i wrote a ymoz, and suddenly the articles is accepted, will the link to our site coming out of that Article Post increased our SEO Standing? Another example would be http://active.tutsplus.com , yesterday i have successfully pitched a tutorial idea, and they told me to write it so that they can published it , and they also promised that i will be able to put my site link (dofollow) ... But will these link be a Good BackLink that will increase our site's SEO Standing? The last one is exactly the same link , but this time coming from a News Site , such as http://teknologi.kompasiana.com/internet/2011/06/09/website-full-flash-dengan-inovasi-hebat-karya-indonesia/ , in this article (kompasiana is a very wellknown site news in Indonesia, in fact KOMPAS is the biggest newspaper firm in Indonesia) , our site is being featured , there is a link coming out of that article (DOFOLLOW), but will that link make our site much more SEO Friendly? Again please enlighten me 🙂
White Hat / Black Hat SEO | | IKT0