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
-
Scraped site, hijacked searches for business name.
Hello, I have a site that was scraped (possibly by a competitor's seo company), who then built links to the duplicate site. When people do a search for the name of the business the scraped site is all that comes up along with the usual third-party sites. They seem to take the site down and put it back up every couple of weeks to maintain the rankings in Google. Has anyone ever dealt with something like this? Any advice or recommendations would be appreciated. Search: LIC Dental Associates Scraped site: old-farmshow.net Legit site: licdentalassociates.com Thanks, Emery
White Hat / Black Hat SEO | | tntdental1 -
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 -
Two sites, heavily cross linking, targeting the same keyword - is this a battle worth fighting?
Hi Mozzers, Would appreciate your input on this, as many people have differing views on this when asked... We manage 2 websites for the same company (very different domains) - both sites are targeting the same primary keyword phrase, however, the user journey should incorporate both websites, and therefore the sites are very heavily cross linked - so we can easily pass a user from one site to another. Whilst site 1 is performing well for the target keyword phrase, site 2 isn't. Site 1 is always around 2 to 3 rank, however we've only seen site 2 reach the top of page 2 in SERPs at best, despite a great deal of white hat optimisation, and is now on the decline. There's also a trend (all be it minimal) of when site 1 improves in rank, site 2 drops. Because the 2 sites are so heavily inter-linked could Google be treating them as one site, and therefore dropping site 2 in the SERPs, as it is in Google's interests to show different, relevant sites?
White Hat / Black Hat SEO | | A_Q0 -
My site www.sriindustries.com dropped to back page penguin 2.1
My website penguin 2.1 dropped back to page 5 and beyond, can you help me to come out from this ? My head is breaking, also I would like to know how to be on top for local business search (maps)
White Hat / Black Hat SEO | | synchronyinfo0 -
Site review
Can any one give me a quick site review, recently started work for the company on the seo, just want to asking if I am missing anything that may hinder SEO and SERPs etc www.teamac.co.uk
White Hat / Black Hat SEO | | TeamacPaints0 -
You're a SEO manager for a new company working on a new site. Where to?
So, you've recently begun as a SEO manager for a new company who's just launched a lovely, gleaming corporate site to boot. The onsite stuff is taken care of and your attention turns to link building. Now you've been in the game for a few years. You've seen things change in that time. Directories are out. Link networks are done. You're not going to embark on reciprocal linking either because it's bad and looks horribly tacky. Black Hat, White Hat - you know the score. You're lucky that the company produces a page or two of news a day - it's original, informative, is great for keeping your clients informed and you punt this on Twitter and FB. A bit of link bait, eh? But there's a rub: your competitors, with their bigger budgets, and industry clout, have been around for a some time longer than your company has been. They've snapped up all the good (industry-related) sites to get links from. You've approached all potential targets with the offer of good, relevant content and affiliate partnerships but they aren't having any of it. You're simply out-sized by the big boys next door - you can't compete. They're rich kids. There just seems nowhere to get links from. Do you just go the route of press releases and articles? Do you use paid blogging services? Grovel at doorsteps. The industry you're in is incredibly commercial - no meek altruist is going to take pity and give you a couple backlinks out of kindness. What do you do? What indeed...?
White Hat / Black Hat SEO | | Martin_S0 -
Thinking of redirecting *all* mobile traffic to another site (via an advertiser) - safe to do?
Hi, I am thinking of redirecting all mobile (iphone, cell phone, etc) to an advertiser (so completely different content than my site). Is there any risk of getting banned from google (etc) for doing this? (this is for an adult site)
White Hat / Black Hat SEO | | dmn020 -
Do backlinks with good anchor text from bad sites help?
Hi, In the Netherlands, the SEO competition for terms like loans is very competitive. I see a website in this industry that seems to be doing very well based on links with good anchor text from sites that seem quite worthless to me, such as: http://www.online-colleges-helper.com/ and http://www.alohapath.com/ My question is: is it worth pursuing this type of links? I assume these must be paid links, or am I wrong? I'd really rather not go down this route but I don't want to be outranked by someone who is using these types of links... Many thanks in advance for any type of insight! Annemieke
White Hat / Black Hat SEO | | AnnemiekevH0