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
-
I'm seeing thousands of no-follow links on spam sites. Can you help figure it out?
I noticed that we are receiving thousands of links from many different sites that are obviously disguised as something else. The strange part is that some of them are legitimate sites when you go to the root. I would say 99% of the page titles read something like : 1 Hour Loan Approval No Credit Check Vermont, go cash advance - africanamericanadaa.com. Can someone please help me? Here are some of the URL's we are looking at: http://africanamericanadaa.com/genialt/100-dollar-loans-for-people-with-no-credit-colorado.html http://muratmakara.com/sickn/index.php?recipe-for-cone-06-crackle-glaze http://semtechblog.com/tacoa/index.php?chilis-blue-raspberry-margarita http://wesleygcook.com/rearc/guaranteed-personal-loans-oregon.html
White Hat / Black Hat SEO | | TicketCity0 -
Different site behind the flag
Hello, I am in a very complicated situation. I have a site in Itaian which is targeted in Italy by webmaster tools so the majority of the organic traffic comes from there and everything is fine. However this site got a link from a major international site. So now I get traffic from all over the world but I can't take advantage of it. From the Italian traffic I get from this site I see high pageviews numbers and many minutes in average visitor time. The problem in this situation is that for many reasons this website cannot be translated so I can put many language choices in this site. I want to ask, If I put, let's say an English flag in top of my site, that will indicate the English language, but instead of the user to see an English version of the site he/she will be redirected(no follow link) to another site of the same content in English, will this violate any of Google's guideline or hurt the seo of the original site? Thank you all!
White Hat / Black Hat SEO | | Tz_Seo0 -
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 -
Partner Site In Bound Links
We have a staffing agency client that uses a 3rd party site (with different URL) to display open jobs for web viewers to see. However we are getting a bunch of backlinks from this site from the footer because it is set up as a White Label... Should I add a rel=nofollow to the links in the footer? Disavow the links from the site? Do nothing? I am not really sure. Thanks!
White Hat / Black Hat SEO | | Aqabatech0 -
Does 301 redirection will effect my site in the future?
Hello Guys, I am totally new to SEOMOZ.com, when I had issues with my website I asked one of my friend who does SEO he suggested me to implemented 301 redirection approximately 11 months a go, here is the URL of the website http://www.bharatdesi.com/hyderabad . Will Google ban my website from search engine results, what would be the worst scenarios. know there are really good SEO people who follow SEOMOZ everyday... Can any one here please suggest me with some good answers weather I have to remove 301 redirection or I can still keep the same until my home page gets redesigned. I don't really understand all the concepts of SEO, but if some one can help me with the good answers I can ask my developer to the same. Thank you
White Hat / Black Hat SEO | | Vinss0 -
Same template site same products but different content?
for the sake of this post I am selling lighters. I have 3 domains small-lighters.com medium-lighter.com large-lighters.com On all of the websites I have the same template same images etc and same products. The only difference is the way the content is worded described etc different bullet points. My domains are all strong keyword domains not spammy and bring in type in traffic. Is it ok to continue in this manner in your opinion?
White Hat / Black Hat SEO | | dynamic080 -
What do Bing and Yahoo look for in a site?
Do Bing and Yahoo look for authoritative sites like google does? Do they punish sites for black hat or spamming? The reason I ask these questions is because one of my competitors was ranking in first place for many great keywords in Google, they have the highest authority out of all of their competitors. They must have been punished by Google because now they are not ranking for any great keywords in Google. However they are ranking 1st in Bing and Yahoo for most the top keywords, getting the the most visibility out of all the sites. I attached a small Graph with latest visibility for the sites with the top keywords from google and then I also included the company that was punished from google they are the green circles on the graph. dIVI4.png
White Hat / Black Hat SEO | | SEODinosaur0 -
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