Help with force redirect HTTP to HTTPS
-
Hi, I'm unsure of where I should be putting the following code for one of my Wordpress websites so that they redirect all HTTP requests to HTTPS.
RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
This is my current htaccess file:
*missing
-
Well done! Glad we could help.
-
Thanks for your help guys. Ive sorted it.
-
Hello. You would put it somewhere after # BEGIN WordPress, depending on when you would want the https redirect to happen. The first settings (WP Rocket) basically optimize your website's speed. You would also want to change the settings from the admin panel and also force the admin to SSL. You can read more here -> https://premium.wpmudev.org/blog/ssl-https-wordpress/. Let me know if you have any other questions.
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
-
Divi Help!
I've added our phone number and email address in the header settings in Divi. For whatever reason, when I'm editing the header elements I can see it, but when I view the website it's not showing... I cannot figure out what the issue is. I've never run into it before. Also, the menu looks different, it does not match what it shows in the header elements edit area vs live site. XLRpuxghzHUN LxPX4iND6B 2ekykrCH7Pn
Intermediate & Advanced SEO | | LindsayE0 -
Migrating 1 page to https
Hi there, Although we do plan to migrate our entire site to https, we currently have only one page on our site which we want to migrate to https, as it has passwords and wotnot on it. Lets say it is httpS://www.example.com/login/ I am not really sure how to go about migrating just one page though.
Intermediate & Advanced SEO | | unirmk
I am guessing that we need to: make sure that httpS://www.example.com/login/ is the only page that exists on httpS:// replace any link to the httpS://www.example.com/login/ version on the http:// version remove httpS://www.example.com/login/ from the http://www.example.com/sitemap.xml create a httpS://www.example.com/sitemap.xml on httpS:// which only references the one page (httpS://www.example.com/login/) 301 http://www.example.com/login/ to https://www.example.com/login/ submit both sitemaps to Google so they know whats up. fetch http://www.example.com/login/ so that google finds the redirect. Anything else?? :S Not too sure about this one. Many thanks for your help.0 -
Is it possible to direct HTTP www 301 to HTTPS non www?
I have a question that has been stumping me and if someone could help I would gladly buy your coffee for a month. I have a website that used to be www and http a year or two ago. Now it is https and non www. A lot of my older links point to the www and http version of my site. This results in two 301 redirects. I.e. A link on another site to my site points to http://www.mysite.com The network waterfall shows: http://www.mysite.com 301 -> http://mysite.com http://mysite.com 301 -> https://mysite.com https://mysite.com (finally) **2 part question. ** **--Do you think that this two 301 redirect hop would affect SEO performance? I can see it did affect page authority through Moz. ** --Is there away around this? I.e. to redirect http:// AND http://www directly to https:// with no hops in between. Thank you!
Intermediate & Advanced SEO | | Stodzy0 -
HTTP HTTPS Migration Gone Wrong - Please Help!
We have a large (25,000 Products) ecommerce website, and we did an HTTP=>HTTPS migration on 3/14/17, and our rankings went in the tank, but they are slowly coming back. We initially lost 80% of our organic traffic. We are currently down about 50%. Here are some of the issues. In retrospect, we may have been too aggressive in the move. We didn't post our old sitemaps on the new site until about 5 days into the move. We created a new HTTPS property in search console. Our redirects were 302, not 301 We also had some other redirect issues We changed our URL taxonomy from http://www.oursite.com/category-name.html to https://www.oursite.com/category-name (removed the .html) We changed our filters plugin. Proper canonicals were used, but the filters can generate N! canonical pages. I added some parameters (and posted to Search Console) and noindex for pages with multiple filter choices to cut down on our crawl budget yesterday. Here are some observations: Google is crawling like crazy. Since the move, 120,000+ pages per day. These are clearly the filtered pages, but they do have canonicals. Our old sitemaps got error messages "Roboted Out". When we test URLs in Google's robots.txt tester, they test fine. Very Odd. At this point, in search console
Intermediate & Advanced SEO | | GWMSEO
a. HTTPS Property has 23,000 pages indexed
b. HTTP Property has 7800 pages indexed
c. The crawl of our old category sitemap (852 categories) is still pending, and it was posted and submitted on Friday 3/17 Our average daily organic traffic in search console before the move was +/-5,800 clicks. The most recent Search Console had HTTP: 645 Clicks HTTPS: 2000 clicks. Our rank tracker shows a massive drop over 2 days, bottoming out, and then some recovery over the next 3 days. HTTP site is showing 500,000 backlinks. HTTPS is showing 23,000 backilinks. I am planning on resubmitting the old sitemaps today in an attempt to remap our redirects to 301s. Is this typical? Any ideas?0 -
Http vs. https - duplicate content
Hi I have recently come across a new issue on our site, where https & http titles are showing as duplicate. I read https://moz.com/community/q/duplicate-content-and-http-and-https however, am wondering as https is now a ranking factor, blocked this can't be a good thing? We aren't in a position to roll out https everywhere, so what would be the best thing to do next? I thought about implementing canonicals? Thank you
Intermediate & Advanced SEO | | BeckyKey0 -
301 redirect recommendations
One of our clients we are working on have two sites the main with a PR5 and a separate one with a PR4. We are planning on doing a 301 from the PR4 to a page on the PR5 Is it best to do: www.PR4.com ----> www.PR5.com/releveantPR4page or www.PR4.com/page ----> www.PR5.com/releveantPR4page Most pages on the PR4 site can fit into one PR5 page logically. However the PR4 has an about us, contact us, blog/with posts, FAQ, Applications, Legal Resources which are all pretty out dated.. The PR4 site is kinda messy and we are not sure if it will be easy to 301 each page individually with the user in mind. can we do a sitewide 301 redirect from the root PR4.com to a page PR/5.com/releveantPR4page and also do deeper 301's? PR4.com/PR4page ---> PR5.com/releveantPR4page
Intermediate & Advanced SEO | | Bryan_Loconto0 -
How do you find all of your 301 redirects?
I would like a full list of 301 redirects that we have on our site. Is there a way to export it? I tried Bing Webmaster tools and the list was incomplete. We use IIS. Any ideas?
Intermediate & Advanced SEO | | EcommerceSite0 -
I dont know what happened?!? Help!
Up until yesturday I was mainly getting entrances to my site through www.moondoggieinc.com/dog-harness.php like 60-70 a day After yesterday, it's dropped to one or two! I haven't made any major changes to the site? I don't know what happened! I am starting to feel really discouraged and don't know what to do! I have no clue what my next move should be in trying to get this site working well in organic search. I feel lost now, PLEASE help! Any suggestions on what to do with http://www.moondoggieinc.com would be a great help! I feel so lost! THANKS! Kristy O
Intermediate & Advanced SEO | | KristyO0