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
-
My indexed site URL removed from google search without get any message or Manual Actions???
On Agust 2 or 3.. I'm not sure about the exact date...
White Hat / Black Hat SEO | | newwaves
The main URL of my website https://new-waves.net/ had been completely removed from Google search results! without getting any messages or Manual Actions on search console ?? but I'm still can find some of my site subpages in search results and on Google local maps results when I tried to check it on google
info:new-waves.net >> no results
site:new-waves.net >> only now I can see the main URL in results because I had submitted it again and again to google but it might be deleted again today or tomorrow as that happen before last few days
100% of all ranked keywords >> my site URL new-waves.net had been completely removed from all results! but I'm still can see it on maps on some results I never get any penalties to my site on Google search console. I noticed some drops on some keywords before that happens (in June and July) but it all of it was related to web design keywords for local Qatar, but all other keywords that related to SEO and digital marketing were not have any changes and been on top My site was ranked number 1 on google search results for "digital marketing qatar" and some other keywords, but the main URL had been removed from 100% of all search results. but you can still see it on the map only. I just tried to submit it again to Google and to index it through google search console tool but still not get any results, Recently, based on google console, I found some new links but I have no idea how it been added to links of my website:
essay-writing-hub.com - 9,710
tiverton-market.co.uk - 252
facianohaircare.com - 48
prothemes.biz - 44
worldone.pw - 2
slashdot.org - 1
onwebmarketing.com - 1 the problem is that all my high PR real links deleted from google console as well although it still have my site link and it could be recognized by MOZ and other sites! Can any one help to know what is the reason?? and how can I solve this issue without losing my previous ranked keywords? Can I submit a direct message to google support or customer service to know the reason or get help on this issue? Thanks & Regards0 -
Multiple sites in the same niche (Should we redirect these to our Main Site)
I will keep this short and sweet. We have some websites in the same niche area but want to focus only on our newest site (basically all the information that was being posted on the other sites will now be part of our new site) This will save us a lot of time and increase our focus on 1 entity. Should we redirect these website with a 301 redirect to the specific categories that they focus on in the new site? or should we redirect to the main domain.
White Hat / Black Hat SEO | | CMcMullen0 -
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 -
Do some sites get preference over others by Google just because? Grandfathered theory
So I have a theory that Google "grandfathers" in a handful of old websites from every niche and that no matter what the site does, it will always get the authority to rank high for the relevant keywords in the niche. I have a website in the crafts/cards/printables niche. One of my competitors is http://printable-cards.gotfreecards.com/ This site ranks for everything... http://www.semrush.com/info/gotfreecards.com+(by+organic) Yet, when I go to visit their site, I notice duplicate content all over the place (extremely thin content, if anything at all for some pages that rank for highly searched keywords), I see paginated pages that should be getting noindexed, bad URL structure and I see an overall unfriendly user experience. Also, the backlink profile isn't very impressive, as most of the good links are coming from their other site, www.got-free-ecards.com. Can someone tell me why this site is ranking for what it is other than the fact that it's around 5 years old and potentially has some type of preference from Google?
White Hat / Black Hat SEO | | WebServiceConsulting.com0 -
Penalty for all new sites on a domain?
Hi @all, a friend has an interesting problem. He got a manuel link penalty in the end of 2011...it is an old domain with domainpop >5000 but with a lot bad links (wigdet and banners and other seo domains, but nothing like scrapebox etc)...he lost most of the traffic a few days after the notification in WMT (unnatural links) and an other time after the first pinguin update in april´12. In the end of 2012 after deleting (or nofollowing) and disavow a lot of links google lifted the manuel penalty (WMT notification). But nothing happened after lifting, the rankings didn´t improve (after 4 months already!). Almost all money keywords aren´t in the top 100, no traffic increases and he has good content on this domain. We built a hand of new trust links to test some sites but nothing improved. We did in february a test and build a completely new site on this domain, it´s in the menu and got some internal links from content...We did it, because some sites which weren´t optimized before the penalty (no external backlinks) are still ranking on the first google site for small keywords. After a few days the new site started to rank with our keyword between 40-45. That was ok and as we expected. This site was ranking constantly there for almost 6 weeks and now its gone since ten days. We didn´t change anything. It´s the same phenomena like the old sites on this domain...the site doesnt even rank for the title! Could it still be an manuel penalty for the hole domain or what kind of reasons are possible? Looking forward for your ideas and hope you unterstand the problem! 😉 Thanks!!!
White Hat / Black Hat SEO | | TheLastSeo0 -
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 -
Has Panda help this site achieve great heights? How? and Why?
Today I went about my business in trying to understand what is happening in our market, eyewear, after the last Panda update. I was interested to know if any of our competitors were effected as much as we were for a very competitive key phrase To my surprise a new kid appeared on the block, well, on page one, position two. Imagine my second surprise, when the new kid turn out to be a 3 month old domain, yes 3 months, with zero page rank and zero back links. I was in for one more surprise before I stood up, walked to the window and gazed into space to contenplate the meaning of Panda and SEO as we know it. This third surprise was the site in question is a counterfeiting site using black hat SEO with fast results. It has a Blog its a good looking site with the key phrase menstioned a hundred times. google-UK-%20Search-Result.jpg panda-help.jpg
White Hat / Black Hat SEO | | ShoutChris0 -
Is this site penalized?
So I am working on a potential new client and they run several very well established and well ranking ecommerce sites. They have 1 site which is new and underperforming which they want me to "start" on as a trial. The idea being that if they like the progress I would take over SEO on the other sites. After a little research I am concerned that this site may be have a penalty. The site is www.discoverhookah.com The MOZrank and MOZtrust are actually pretty good considering the site is 6 months old, but if you look at the links they are ALL junk. They seems to be some reciprocal linking as well. I believe this is something they have done on their other sites and been ok with because they are 10+ years old and very trusted, however for a new site this link profile worries me. I do not have their analytics yet but looking at their traffic in compete.com shows a HUGE drop off shortly after the site went up (like from 2500 to under 100 visitors). I dont really trust compete.com's numbers outside of being and good indicator for trends, but it has me concerned. The client did tell me they are getting virtually no traffic. I am waiting on the crawl report to confirm its not a crawl or onsite problem but i dont think it is. I have 2 concerns: 1. I am taking this site on the cheap in order to establish a successful project, so I can work on their other sites, and I dont want to walk into a losing situation on the cheap! 2. I believe their webmaster is following some misguided SEO strategies but she has been with them for a long time. I dont think she wants to do theor SEO anyway, as she is very busy with maintenance and development, but if I could prove a penalty it would go a long way in helping me win the whole account from an SEO standpoint.
White Hat / Black Hat SEO | | BlinkWeb0