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
-
We have a site with a lot of international traffic, can we split the site some way?
Hello, We have a series of sites and one, in particular, has around 75,000 (20%) monthly users from the USA, but we don't currently offer them anything as our site is aimed at the UK market. The site is a .com and though we own the .co.uk the .com is the primary domain. We have had a lot of success moving other sites to have the .co.uk as the primary domain for UK traffic. However, in this case, we want to keep both the UK traffic and the US traffic and if we split it into two sites, only one can win right? What could do? It would be cool to have a US version of our site but without affecting traffic too much. On the other sites, we simply did 301 redirects from the .com page to the corresponding .co.uk page. Any ideas?
White Hat / Black Hat SEO | | AllAboutGroup0 -
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 -
Site Footer Links Used for Keyword Spam
I was on the phone with a proposed web relaunch firm for one of my clients listening to them talk about their deep SEO knowledge. I cannot believe that this wouldn’t be considered black-hat or at least very Spammy in which case a client could be in trouble. On this vendor’s site I notice that they stack the footer site map with about 50 links that are basically keywords they are trying to rank for. But here’s the kicker shown by way of example from one of the themes in the footer: 9 footer links:
White Hat / Black Hat SEO | | RosemaryB
Top PR Firms
Best PR Firms
Leading PR Firms
CyberSecurity PR Firms
Cyber Security PR Firms
Technology PR Firms
PR Firm
Government PR Firms
Public Sector PR Firms Each link goes to a unique URL that is basically a knock-off of the homepage with a few words or at the most one sentences swapped out to include this footer link keyword phrase, sometimes there is a different title attribute but generally they are a close match to each other. The canonical for each page links back to itself. I simply can’t believe Google doesn’t consider this Spammy. Interested in your view.
Rosemary0 -
Will including a global-site link in all 100 local-sites footer be considered spammy?
If I am a car manufacturer brand site(global), and I request all my location-specific domains include a link to the global site in their footers, would this trigger a red flag for Google? There are roughly 100 location-specific sites, but I would like to come up with a long term solution, so this number could be larger in the future. Is it best practice to only follow the footer link on each location-specific site Homepage, and nofollow the rest of the footer links on each site? Is it best to only include one followed link to the manufacturer brand site (global) on each location-specific domain? Is it best to not put this global link in the footer, but rather towards the top of the page only on the homepage?
White Hat / Black Hat SEO | | Jonathan.Smith0 -
Site dropping in rank even through there are more backlinks being added
Hello, One of my client's sites is ranking lower than he should. This happened when we took off backlinks (20 little blogs, several site-wide paid links. It really dropped the site, but it had to be done. Since then we've increased his # of root domains by 10% through white hat link building in his non-competitive niche, and rankings are still poor. I know that's not much in the way of added backlink value, but we're working on it. My question is, how have the recent (and coming) updates possibly effected us. We want to take the remaining problem areas off right away, but another drop in traffic is not a good idea. Even though the blogs (see below) have no backlinks of themselves, they cause drops when taken off) He still has -20 little blog backlinks w/ a quarter of them being exact match anchor text.
White Hat / Black Hat SEO | | BobGW
-1 sitewide paid link - an image, exact match alt tag anchor text
-1 non-site-wide paid links that is an image near the footer, exact match alt tag anchor text.
-3 links on a domain, this one looks fairly editorial, but there are a bunch of paid links on that page. Changing to non-exact-match anchor text
-2 links on two domains that look completely editorial with no other paid links on that page. non-exact-match anchor text -70 backlinks total with about 1/3 being problematic. How does this site look in regards to updates and when to take links off without tanking our site even more? Thanks.0 -
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 -
What on-page/site optimization techniques can I utilize to improve this site (http://www.paradisus.com/)?
I use a Search Engine Spider Simulator to analyze the homepage and I think my client is using black hat tactics such as cloaking. Am I right? Any recommendations on to improve the top navigation under Resorts pull down. Each of the 6 resorts listed are all part of the Paradisus brand, but each resort has their own sub domain.
White Hat / Black Hat SEO | | Melia0 -
Opinions Wanted: Links Can Get Your Site Penalized?
I'm sure by now a lot of you have had a chance to read the Let's Kill the "Bad Inbound Links Can Get Your Site Penalized" Myth over at SearchEngineJournal. When I initially read this article, I was happy. It was confirming something that I believed, and supporting a stance that SEOmoz has taken time and time again. The idea that bad links can only hurt via loss of link juice when they get devalued, but not from any sort of penalization, is indeed located in many articles across SEOmoz. Then I perused the comments section, and I was shocked and unsettled to see some industry names that I recognized were taking the opposite side of the issue. There seems to be a few different opinions: The SEOmoz opinion that bad links can't hurt except for when they get devalued. The idea that you wouldn't be penalized algorithmically, but a manual penalty is within the realm of possibility. The idea that both manual and algorithmic penalties were a factor. Now, I know that SEOmoz preaches a link building strategy that targets high quality back links, and so if you completely prescribe to the Moz method, you've got nothing to worry about. I don't want to hear those answers here - they're right, but they're missing the point. It would still be prudent to have a correct stance on this issue, and I'm wondering if we have that. What do you guys think? Does anybody have an opinion one way or the other? Does anyone have evidence of it being one way or another? Can we setup some kind of test, rank a keyword for an arbitrary term, and go to town blasting low quality links at it as a proof of concept? I'm curious to hear your responses.
White Hat / Black Hat SEO | | AnthonyMangia0