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
-
Please help need some advice?
Can any of you guys please help me I have alerts on links coming in and it looks like recently someone did this, it looks maliciously done as it is only our domain mentioned and most are brand new posts? http://testosteroneclinicindenve53950.shotblogs.com/testosterone-clinic-in-denver-fundamentals-explained-6102386 http://claytondmnnp.ampedpages.com/Details-Fiction-and-testosterone-clinic-in-denver-16897309 http://vinylvehiclecarwrap38041.alltdesign.com/a-review-of-vinyl-vehicle-car-wrap-9574042 http://devinxccct.educationalimpactblog.com/1784474/little-known-facts-about-vinyl-vehicle-car-wrap http://keeganbsftf.ka-blogs.com/7488539/how-vinyl-vehicle-car-wrap-can-save-you-time-stress-and-money http://andybxoes.thezenweb.com/vinyl-vehicle-car-wrap-Fundamentals-Explained-17581028 http://kylerhfdzu.blogkoo.com/not-known-details-about-vinyl-vehicle-car-wrap-9029141 http://troyytkyn.timeblog.net/7695911/the-greatest-guide-to-vinyl-vehicle-car-wrap http://waylontyzab.pointblog.net/testosterone-clinic-in-denver-Secrets-16335972 http://testosteroneclinicindenve30516.onesmablog.com/Top-testosterone-clinic-in-denver-Secrets-17252737 http://emiliogkmop.blogofoto.com/7667522/top-guidelines-of-testosterone-clinic-in-denver http://caidenaczxt.blogs-service.com/7514172/testosterone-clinic-in-denver-fundamentals-explained http://daltonpyfms.mybjjblog.com/5-simple-statements-about-testosterone-clinic-in-denver-explained-6517932 Should I try to disavow these and submit to google or will google know our site which has been up for 5 years is not doing this? Should I do any of these https://tehnoblog.org/google-webmaster-tools-my-website-got-bombed-with-backlinks-what-to-do/
Intermediate & Advanced SEO | | BobAnderson0 -
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 -
Google cache is for a 3rd parties site for HTTP version and correct for HTTPS
If I search Google for my cache I get the following: cache:http://www.saucydates.com -> Returns the cache of netball.org (HTTPS page with Plesk default page) cache:https://www.saucydates.com -> Displays the correct page Prior to this my http cache was the Central Bank of Afghanistan. For most searches at present my index page is not returned and when it is, it’s the Net Ball Plesk page. This is, of course hurting my search traffic considerably. ** I have tried many things, here is the current list:** If I fetch as Google in webmaster tools the HTTPS fetch and render is correct. If I fetch the HTTP version I get a redirect (which is correct as I have a 301 HTTP to HTTPS redirect). If I turn off HTTPS on my server and remove the redirect the fetch and render for HTTP version is correct. The 301 redirect is controlled with the 301 Safe redirect option in Plesk 12.x The SSL cert is valid and with COMODO I have ensured the IP address (which is shared with a few other domains that form my sites network / functions) has a default site I have placed a site on my PTR record and ensured the HTTPS version goes back to HTTP as it doesn’t need SSL I have checked my site in Waybackwhen for 1 year and there are no hacked redirects I have checked the Netball site in Waybackwhen for 1 year, mid last year there is an odd firewall alert page. If you check the cache for the https version of the netball site you get another sites default plesk page. This happened at the same time I implemented SSL Points 6 and 7 have been done to stop the server showing a Plesk Default page as I think this could be the issue (duplicate content) ** Ideas:** Is this a 302 redirect hi-jack? Is this a Google bug? Is this an issue with duplicate content as both servers can have a default Plesk page (like millions of others!) A network of 3 sites mixed up that have plesk could be a clue? Over to the experts at MOZ, can you help? Thanks, David
Intermediate & Advanced SEO | | dmcubed0 -
PushState for redirects
Is it possible to use PushState for redirects from one site to another?
Intermediate & Advanced SEO | | rgamedia_seo0 -
Help - Lost Ranking - What did I screw up?!
Hi, We're working with a local service provider with a location specific keyword (not a real example: "orlando plumbing contractors"). Background:
Intermediate & Advanced SEO | | AaronHenry
In recent history the client updated a new site design and upgraded from Joomla 1.5 to Joomla 2.5. Of course there were duplicate content issues which have been resolved with the help of AceSEF. Duplicate content, title tags, and other content issues are handled as soon as they appear in GWT or MOZ. Additionally, a high number of backlinks were lost when the latest Google update hit. Many of these sites were of sites that no longer existed or were spammy and flushed out. Some were lost due to the previous SEO firm literally removing backlinks and switching them to their new client (seo firm was putting all of the work the client paid for under their name to control everything). Current Situation: The backlink loss seems to have been stopped (hopefully) because we are using a new strategy that relies solely on the quality of the links, surrounding text, varied anchor text, relevancy, etc.) However, we tried an experiment on just one of the clients keywords. That experiment seems to have blown up in our faces evidently. The landing page for the location specific keyword has dropped from the index completely (it seems), but only when searching broad. When using exact match with quotes like the example quoted above ("orlando plumbing contractors") the landing page appears, but several ranks lower. We were ranked yesterday 6/23/13, but as of today 6/24/13 are no longer ranked. On broad matches, non-relevant sites and even a site that shows only a broken server configuration is outranking the client (they appear for the broad search, but the client does not). What Was Done
We recently created a press release for and posted it on a press release site. We then created a link back to the landing page (exact match anchor text). We posted the PR article to several social sites (Google plus, folkd, delicious, twitter, stumble upon, diigo). We also created a blog article (on-site) on site for that, creating links back to the landing page (the links all had exact anchor text). We posted that blog article to social news sites (facebook, stumble, delicious) and included a ping. The PR article was manually rewritten and posted to the PR site (we had to make 2 versions of the PR; one for the blog and one for the PR site). The Result
The client ending up dropping off the broad search rankings, but only slipped a few for "exact match" (with quotes). The PR article that was created is now ranked on page 3 for the board keyword and is still beat by non working sites. We suspect that the exact anchor text could be causing this problem. Anyone else have an idea (we're scratching our heads and trying not to freak out at the same time).0 -
301 redirect rule
Hi there, I have a website that has hundreds of links with a "question mark" at the end of URLs. For example: http://www.domain.com/directory/page.html?
Intermediate & Advanced SEO | | iQandil
http://www.domain.com/directory/another-directory?
http://www.domain.com/directory/yet-another-directory/? I'm want to place a wildcard redirect on the .htaccess file but don't know what exactly to add. Ideally I want the URLs above to be: http://www.domain.com/directory/page.html
http://www.domain.com/directory/another-directory/
http://www.domain.com/directory/yet-another-directory/ Any help is most appreciated. Thanks
Issa0 -
Please help me with your advice
Hi all, Couple years ago I started to build my business based on EMD domain. The intention was to create the source with the rich unique content. After a year of hard work the site achieved top 10 in Google and started to generate good amount of leads. Then Google announced the EMD Update and site lost the 90% of traffic (after Pandas updates our SERP was steady ) “ a new filter that tries to ensure that low-quality sites don’t rise high in Google’s search results simply because they have search terms in their domain names. ” But I don’t consider my site low-quality site, every page, every post is 100% unique and has been created only to share the knowledge with others… The site has EXCELLENT content from industry point of view.... Since the “ EMD Update “ I read hundreds , hundreds of different articles and opinions related to EMD update and finally I am confused and lost. What should I do… • Kill the site and start new one
Intermediate & Advanced SEO | | Webdeal
• Get more links, but what type of links and how I should get them
• Keep hoping and pray....
• Or do something else Please help me with your advice0