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
-
Want to remove a large amount of links from spam sites. SEO company says we will lose a lot of link juice?
Hi, We have a lot of links that have a spam score above 30% and 60%. I don't know if someone has spammed our website. However our SEO company has said we should remove these carefully over a period of 3 months while they add new good links. I don't quite trust this advice. Are they trying to get more business?? They have put doubt in our mind. Can anyone please shed any light on this?? Thank you
White Hat / Black Hat SEO | | YvonneDupree0 -
My site just dropped significant!
Just noticed that my website onlinecasting.co.za just dropped 50+ places on basically all the keywords I'm following.
White Hat / Black Hat SEO | | KasperGJ
I can also see, that today there almost havent been any new sign-ups so something happened.
I didnt change anything. On issue, which might have something to do with it, is that I own several "copies" of the same site, just in different countries (domains). I host the websites myself, and they are all on the same server. The text and design in the same in some of the countries except that "jobs" are unique for the country. I also have:
onlinecasting.ae (english)
onlinecasting.sg (english)
onlinecasting.mx
and more coming So, could that be the reason, that google somehow now decided, that it wont accept the "allmost same site"?0 -
Do you see sites with unfixable Penguin penalties?
Hello, We have a site with 2 Penguin update penalties (drops in traffic) and one quality penalty (another drop in traffic) all years ago, both just drops in rankings and not messages in Google Console. Now that Penguin is hard coded, do you find that some sites never recover even with a beautiful disavow and cleanup? We've added content and still have some quality errors, though I thought they were minor. This client used to have doorway sites and paid links, but now is squeaky clean with a disavow done a month ago though most of the cleanup was done by deletion of the doorways and paid links 9 months ago. Is this a quality problem or is our site permanently gone? Let me know what information you need. Looking for people with a lot of experience with other sites and Penguin. Thanks.
White Hat / Black Hat SEO | | BobGW2 -
Whether to disavow fettish sites
Hello, In one niche, all competitors have fettish backlinks. Some of these sites have related products on them, some are just information, but some border on porn sites. I'm wondering which if not all of these I should disavow. There's quite a few. We're doing a non-manual penguin recovery based on link building like paid links, unnatural anchor text and doorway sites. Thanks.
White Hat / Black Hat SEO | | BobGW0 -
How do I get more video reviews on a new site?
Hi, I'm working on a site that has video reviews of various places. It's general information/experience that most people possess and production-wise they are selfies. These videos are then transcribed and, voila... searchable content. My problem is this... how do I get large numbers of people to go to the trouble to make a 2 minute selfie? I thought about HARO, since one could work in a plug for something, but they have a site traffic threshold that this new site isn't at. Any and all ideas on how to efficiently generate this content for a new site with very little traffic would be appreciated. Thanks!
White Hat / Black Hat SEO | | 945010 -
Google authorship and multiple sites with multiple authors
Hi guys :). I am asking your help - basically I would like to know what would be the best way to set all of this up. Basically I have two main (e-commerce) sites, and a few other big web properties. What I would like to know is if it is ok to link the main sites to my real G+ account, and use alias G+ accounts for other web properties, or is that a kind of spamming? The thing is that I use a G+ account for those e-commerce sites, and would not necessarily want the other web properties to be linked to the same G+ account, as they are not really related. I do hope I was clear. Any insight would be appreciated. Thanks.
White Hat / Black Hat SEO | | sumare0 -
Beating the file sharing sites in SERPs - Can it be done and how?
Hi all, A new client of mine is an online music retailer (CD, vinyls, DVD etc) who is struggling against file sharing sites that are taking precedence over the client's results for searches like "tropic of cancer end of things cd" If a site a legal retailer trying to make an honest living who's then having to go up against the death knell of the music industry - torrents etc. If you think about it, with all the penalties Google is fond of dealing out, we shouldn't even be getting a whiff of file sharing sites in SERPs, right? How is it that file sharing sites are still dominating? Is it simply because of the enormous amounts of traffic they receive? Does traffic determine ranking? How can you go up against torrents and download sites in this case. You can work on the onsite stuff, get bloggers to mention the client's pages for particular album reviews, artist profiles etc, but what else could you suggest I do? Thanks,
White Hat / Black Hat SEO | | Martin_S0 -
Penguin destroys 1 of my sites! Any ideas why the other was spared?
I have 2 main sites for my business. One is a creaky homestead site about 4 years old Another is a much more sophisticated wordpress site now almost 2 years old. That site's traffic steadily increased until May of 2011 when it suffereed a 25 to 30% decline probably due to Panda. I did all of the recommended fixes with little effect until about 3 months ago when its traffic started going up again and had almost a complete recovery until last week when my traffic is down about 95%. I strongly suspecct the penguin. Interestingly, my old site has been virtually unaffectted even though bost sites are fairly similar, on both sites I started with a lot of directory links including DMOZ, Yahoo, BOTW, some strong lawyer sites like NOLO.COM, Lawyers.com, and others not so strong but I tried to get the best directories I could find. Then I started getting a lot of natural links but some of these aee pretty junky sites and scraper type sites. I am curious if anyone has any thoughts on why www.uncontesteddivorce-nyc.com was hit so hard while www.affordable-uncontested-divorce.com is unscathed. The newer site has, accoring to majestic seo and market samurai, around 35, 000 backlinks, while the older site has around 3500. Thanks, Paul
White Hat / Black Hat SEO | | diogenes0