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
-
Algorithmically penalized site
I have been doing SEO for years, but luckily have never had a client penalized or had to go through that. I see everyone talking about it at conferences and know the absolute basics of recovery, but just had someone come to me that was algorithmically penalized about two years ago. They have no actual data to show me a date and they couldn't tell me a specific date. According to them, their SEO disappeared and wouldn't give them access to the analytics. They are definitely showing just about every red flag with anchor tags and low trust links and tons of duplicate content. Just about everything. I realize you don't have the deep data to go by, but are there cases when it is just better to start over from scratch. They have literally thousands of bad links and strange site pages that they say they weren't even aware of. Whether they were or not I guess isn't the point now, but I have heard rumors that if you start over, Google will still figure it out and follow you with the penalty. Is this true or documented? Don't want to potentially recommend that if that is something that generally happens to bad offenders. Happy to do the work and try to resolve their issues, but it is a lot of work and is going to be expensive and want to present other options. Thanks and any thoughts suggestions are appreciated.
White Hat / Black Hat SEO | | jeremyskillings0 -
Can I use content from an existing site that is not up anymore?
I want to take down a current website and create a new site or two (with new url, ip, server). Can I use the content from the deleted site on the new sites since I own it? How will Google see that?
White Hat / Black Hat SEO | | RoxBrock0 -
New Site Structure
Greetings SEOmoz Team and Users, I need some advise, our site has more products to offer so I am try to optimize the index for a general term and each page product for it's own main keyword. Our site offers accommodation such apartments, hotels and vacation rentals so this is my structure: Index: Main Keyword 1 | Keyword 2 | Site name(brand name) Page Product 1: Main Keyword 1 | Keyword 2 | Site name (brand name) Page Product 2: Main Keyword 1 | Keyword 2 | Site name (brand name) Also can I use the brand name at the end of title tag with separate words ? example: londonescape or london escape or londonescape.net London Apartments | short term london apartments | London Escape or London Apartments | short term london apartments | LondonEscape I think ''London Escape'' is better because has more popularity. Looking forward to hear from you. Thanks, Giuseppe
White Hat / Black Hat SEO | | WorldEscape0 -
Is my competitor up to no good? Strange site-explorer results.
I'm researching a competitor using site explorer and the seomoz toolbar and getting some strange results. When you search by the domain name in site explorer you get no results, but the toolbar shows 170K incoming links. http://www.opensiteexplorer.org/links?site=www.augustagreenlawns.com I noticed the top referring page was a strange internal url so I ran that through site explorer and discovered 19 links.. When you put the strange link in a browser, it redirects to the home url;.. At this url the toolbar shows 220 links and semoz shows 19 http://www.augustagreenlawns.com/?xid_78e7f=0f2a64344c8de6bdf2d8cdf8de93ea5c http://www.opensiteexplorer.org/links?site=www.augustagreenlawns.com%2F%3Fxid_78e7f%3D0f2a64344c8de6bdf2d8cdf8de93ea5c What is up with that url? What are they doing? This is a site ranking #1 for my local search term even though he has about 50 pages of almost duplicate content. See link below. I'm really scratching my head here. http://www.augustagreenlawns.com/home.php?all=categories
White Hat / Black Hat SEO | | dwallner0 -
Can anyone recommend a Google-friendly way of utilising a large number of individual yet similar domains related to one main site?
I have a client who has one main service website, on which they have local landing pages for some of the areas in which they operate. They have since purchased 20 or so domains (although in the process of acquiring more) for which the domain names are all localised versions of the service they offer. Rather than redirecting these to the main site, they wish to operate them all separately with the goal of ranking for the specific localised terms related to each of the domains. One option would be to create microsites (hosted on individual C class IPs etc) with unique, location specific content on each of the domains. Another suggestion would be to park the domains and have them pointing at the individual local landing pages on the main site, so the domains would just be a window through which to view the pages which have already been created. The client is aware of the recent EMD update which could affect the above. Of course, we would wish to go with the most Google-friendly option, so I was wondering if anyone could offer some advice about how would be best to handle this? Many thanks in advance!
White Hat / Black Hat SEO | | AndrewAkesson0 -
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 -
Should this site be punished?
Every summer for the past 4 years one of our customer's competitors suddenly has a big jump in Google's (.co.uk) rankings for some of the main industry phrases, particularly "air conditioning". We were always under the impression that they bought links before the busy summer season, as they have these strange massive jumps in the rankings. (for the rest of the year they often drop down) I recently checked out some of the back-links going to their site and noticed something I'd not seen before. Of the (approx) 480 links that showed up, around 80% of the SourceURL's ended with "?Action=Webring" (see 1st attached image). To me it doesn't look natural at all and I'm surprised that Google hasn't picked up on. Their site is www.aircon247.com. It had been mentioned to me that this may be to do with link sharing sites (which I assume is black-hat) but I'm not 100% sure that they are doing this. They also have an identical long spammy-looking footer at the bottom of every page which is clearly only for search engines to see. We reported it to Google a year ago but no action was taken. Do you think that it is acceptable to have it on every page? (see 2nd attached image) I would be interested to know your thoughts on both of these, and whether this would be a dangerous tactic to try and emulate? Gc5MU.png iXGA9.png
White Hat / Black Hat SEO | | trickshotric0 -
How much pain can I expect if I change the URL structure of the site again?
About 3 months ago I implemented a massive URL structure change by 'upgrading' some of the features of our CMS Prior to this URL's for catergorys and products looked something like this http://www.thefurnituremarket.co.uk/proddetail.asp?prod=OX09 I made a few changes but din't implement it fully as I felt it would be better to do it instages as the site was getting indexed more thouroughly. HOWEVER... We have just hit the first page for some key SERP's and I am wary to rock the boat again by changing the URL structures again and all the sitemaps. How much pain do you think we could feel if i went ahead and optimised the URL's fully? and What would you do? 🙂
White Hat / Black Hat SEO | | robertrRSwalters0