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
-
After 301 redirect
hello i do after 301 redirect from old domain to new since 3 month ago my qa : should i replace the backlinks links to new doamin Or the he backlinks in the old link will works
Intermediate & Advanced SEO | | cristophare790 -
301 Redirection
Hi there guys, I have a question about redirection. My boss has just bought a new domain name and he wants it to redirect to our current site when looking for specific products. www.example.com is our current website www.productname.com is the new domain So the new domain would be redirected to example.com. Would that be considered against Google Policies? Thanks
Intermediate & Advanced SEO | | PremioOscar0 -
Implementing Large-Scale Redirects
Hello All, I have a situation with my site where a vendor created a local directory of locations on a sub-domain of my site. This sub-domain has approximately 2000 pages. It is a PR3 and a good backlink profile (not many links. Mostly citations. Not spammed). It get decent traffic but 80% of the traffic is driven by ppc. We have created a new local section on the main page of our website and we are trying to weigh the benefit of redirecting all of those pages on the old sub-domain. We anticipate that this new section will begin to replace the old sub-domain in serps. Additionally, when our deal with the company that manages this sub-domain ends in three months, the pages will no longer exist. Is it worth redirecting the pages (you might need more information to give good insight into that)? Also, if we do implement approx. 2000 redirects, what effect will that have on the main site from an SEO perspective. Is it possible that Google might ignore this large scale redirect effort? Will the value also be limited by the fact the redirect might only be live for a month before the original pages are deleted? Any help/insight with this would be greatly appreciated. Thanks!
Intermediate & Advanced SEO | | ResponseMine0 -
Can someone help me with RegEx?
Hey! I am having a tough time figuring this out, and I have already signed up for my RegEx course. So in the mean time, could you please help me? I have two old URLs: /faq /faq.php The new one is /faqs How can I write a 301 redirect to include faq & faq.php in the same line? I basically want to capture /faq and anything beyond the q including the .php. I thought this would work: Redirect 301 /faq. http://www.blah.com/faqs Using the period to catch everything after the q and redirect it to the /faqs page. Extra credit: And why Redirect 301 vs. RedirectMatch 301? It is an Apache server and mod_ rewrite is on. Thanks in advance!
Intermediate & Advanced SEO | | cyberlicious0 -
How can i redirect my site to other domain ?
I have been running an eCommerce site since 2008 and have a PR3 with mostly have an authority link from reputed sites, how can I transfer my existing eCommerce site to the new domain so in the new domain i get SEO value from the old domain. Please advice.
Intermediate & Advanced SEO | | chandubaba0 -
Time sensitive: HELP! We are having a problem doing a 301 redirect.....what can we do instead?
Our website has dynamic URLs and we are moving to another server/platform. 301 redirects is looking like a highly unlikely solution. A 3rd party company is handling the back-end of the website which they say works more like a "search engine" than a traditional website. Maybe that explains why they're having a hard time with the 301 redirects. Worst case scenario: we can't use the 301 redirect. What else can we do? We are considering "Indicate your canonical (preferred) URLs by including them in a Sitemap" as Google describes here: http://support.google.com/webmasters/bin/answer.py?hl=en&answer=139066#2. I'm wondering if this method only applies to duplicate content........and what would happen once the old website results in a 404 page...... HELP! We need to cross over to the new platform as soon as possible.
Intermediate & Advanced SEO | | PatriotOutfitters810 -
Please help on this penalized site!
OK, this is slowly frying my brain and would like some clarification from someone in the know, we have posted multiple reconsideration requests the regular "site violates googles quality guidelines" .."look for unnatural links etc" email back in March 2012, I came aboard the business in August 2012 to overcome bad SEO companies work. So far i have filled several disavow requests by domain and cleared over 90% of our backlink profile which where all directory, multiple forum spam links etc from WMT, OSE and Ahrefs and compiled this to the disavow tool, as well as sending a google docs shared file in our reconsideration request of all the links we have been able to remove and the disavow tool, since most where built in 2009/2010 a lot where impossible to remove. We managed to shift about 12 - 15% of our backlink profile by working very very hard too remove them. The only links that where left where quality links and forum posts created by genuine users and relevant non spam links As well as this we now have a high quality link profile which has also counteracted a lot of the bad "seo" work done by these previous companies, i have explained this fully in our reconsideration request as well as a massive apology on behalf of the work those companies did, and we are STILL getting generic "site violates" messages, so far we have spent in excess of 150 hours to get this penalty removed and so far Google hasn't even batted an eyelid. We have worked SO hard to combat this issue it almost feels almost very personal, if Google read the reconsideration request they would see how much work we have done too remove this issue. If anyone can give any updates or help on anything we have missed i would appreciate it, i feel like we have covered every base!! Chris www.palicomp.co.uk
Intermediate & Advanced SEO | | palicomp0 -
Global Redirection Rules
SEO Moz Community: After twice changing directory software, I have a ton of 404 errors in Webmaster Tools (over 3,000). I've decided to do 301 redirects but can't manually enter in each 404 URL. How can you redirect pages from the same folder on a mass scale? For example, mysite.com/autos has hundreds of pages associated with it (/autos/ford, toyota etc.) How can you do a 301 that redirects all those pages without manually entering in each URL? Site is built on Wordpress
Intermediate & Advanced SEO | | JSOC0