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
-
Recovery from a HTTP to HTTPs migration using 302s ?
If a website did an HTTP to HTTPS migration using 302 re-directs, that were corrected to 301s about 4 months later, what is the expected impact? Will the website see a full recovery or has the damage been done? Thanks to anyone who can shed some light on this...
Intermediate & Advanced SEO | | yaelslater0 -
Robots.txt and redirected backlinks
Hey there, since a client's global website has a very complex structure which lead to big duplicate content problems, we decided to disallow crawler access and instead allow access to only a few relevant subdirectories. While indexing has improved since this I was wondering if we might have cut off link juice. Since several backlinks point to the disallowed root directory and are from there redirected (301) to the allowed directory I was wondering if this could cause any problems? Example: If there is a backlink pointing to example.com (disallowed in robots.txt) and is redirected from there to example.com/uk/en (allowed in robots.txt). Would this cut off the link juice? Thanks a lot for your thoughts on this. Regards, Jochen
Intermediate & Advanced SEO | | Online-Marketing-Guy0 -
Geo-Redirect: good idea or not?
Hi Mozzers, The background: I have this very corporate .com domain which is used worldwide. Next to that, we have another .com domain which is specifically created for the US visitors. Within the organic rankings, we notice that our corporate domain is ranking much better in the US. Many visitors are arriving on this domain. As it is a corporate domain being used worldwide, they get lost. My questions: I know there are ways to redirect by location. Would it be smart to automatically redirect US visitors for the corporate domain to the commercial US-specific domain? Is it possible to only redirect US visitors and leave the website as it is for visitors from other countries. Won't this harm the corporate website (organically) worldwide? If this would be a good idea, any recommended plugins or concrete procedures? Thank you so much for helping me out!
Intermediate & Advanced SEO | | WeAreDigital_BE
Sander0 -
Multi Language Redirect Issues
Hello everyone, this is my first post and as so let me first say, Thank you! The SEO Moz community and SeoMozPro have been giving a great help in making my workflow simpler and richer. Lately I've been reading and learning a lot about indexation, in the process I have been making several improvements to some websites, but there is one particular that I am not able to understand. I am writing this post to ask for your help on an issue related to this website: www.dengun.com We are a Web Agency based in Portugal and most our clients are from Portugal. We have an English version and a Portuguese version of the website. It is setup like this: www.dengun.com/en www.dengun.com/pt When the user hits www.dengun.com it redirects to /en or /pt acording to the browser language. The HTTP status code is 302, i was reading in SEOMoz that this is bad because it's not passing rank to the other pages. Will a 301 redirecting to /en and /pt according to the browsers language? What is the best solution? Thanks.
Intermediate & Advanced SEO | | PedroSaiote0 -
Help Identifying Unnatural Links
http://bit.ly/XT8yYYHi,Any help with the below will be most appreciated.We received an unnatural links warning in Webmaster Tools and noticed a large drop in our rankings. We downloaded and carried out a full link audit (3639 links) and logged in an excel spreadsheet with the following status: OK, Have Contacted, Can't Contact, Not SureWe have had some success but the majority of the ones we identified are not contactable.We use the dis-avow tool to tell Google of these. We then submitted a reconsideration request where we explained to Google our efforts and that we can supply them with our audit if necessary by email as you can't upload any evidence.A few days later we received a response suggesting that we still have unnatural links. We are a little stuck as we don't know what they can be:1. Is Google actually looking at our dis-avowed links before making this judgement?2. We have missed something that Google is considering bad but we can't see in our audit?Again we need a little help as we are trying to sort this out but can't see what we are falling down on.I can provide our spreadsheet if necessary.Many ThanksLee
Intermediate & Advanced SEO | | LeeFella0 -
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 -
301 redirects.
Hi everyone, I am having some issues with an a few dynamic URLs that are not redirecting; Example: http://www.example.com/shop-online?page=shop.product_details&flypage=flypage_images.tpl&product_id=69164&category_id=303 I first tried to carry out a standard 301 which looked like this; Redirect 301 /longurlwith&category_id=303 http://www.example.com/new-url Which didn't work. After a little bit of research I added the following into the htaccess file; RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]RewriteRule ^/shop-online$(.*)$ http://www.example.com/shop-online$ [NE,L,R=301] Which caused the website to error 500 (Not cool). So now I am stumped. Any help would be really appreciated as I'm sure it's an easy fix but I can't quite my finger on it. Thanks in advance :).
Intermediate & Advanced SEO | | AduroLabs0 -
Anchor text help
Hello, I am a small website designer in Mexico.. as you know it is hard to rank in these keywords My main competitors appear with (diseño web = web design) on google.com.mx Almost 80% of the anchor text from my links are (diseño web Mexico =web design Mexico) If I search (diseño web Mexico =web design) on google.com.mx I appear on first page. If I search (diseño web = web design) on google.com.mx I appear on page 3. My questions: Is this because my anchor text is diseño web Mexico? should i change it to (diseño web = web design)? Or is it because (diseño web = web design) is a harder key word to rank? this is my website http://bit.ly/eKyWvr Regards
Intermediate & Advanced SEO | | Pixelar0