Best practice to redirect http to https
-
I have an SSL certificate on our domain but at times some search results still list the HTTP version. Clicking on this then warns the user about security and they leave. To avoid this I am using this in the htaccess file to redirect all HTTP visits to the https version.
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://domain.com/$1 [R,L]Is this ok? I notice on Moz toolbar it give a 302 temporary redirect I am thinking this isn't good and needs to be a 301 maybe? What is the best practice in this situation?
-
Ok thanks anyone know what i need to do to adjust my htaccess code?
-
Sorry i mean prefferd domain https://support.google.com/webmasters/answer/44231?hl=en
I'm not familiar with customizing a htaccess file.
Kind regards,
Jeroen
-
Thanks, i have added the new domain to search console. How do you set priority domain?
Also in regard to the code i have in htaccess. What do i need to add to it to make it do a 301?
Thanks
-
Hi,
I should advise a 301 perm. redirect. remember, it wil take some time before google index all your new pages ( 6 weeks)
don;t forget to add your new domain to search console.
Kind regards,
Jeroen
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
-
Best Practices for SEO 2021
What are the best way to do on page and off page seo in 2021?
Intermediate & Advanced SEO | | SaraClay0 -
HTTPS & Redirects
Hi We're moving to https imminently & I wondered if anyone has advice on redirects. Obviously we'll be redirecting all http versions to https - but should I be checking how many redirects are in each chain and amending accordingly? If there's 4-5 in a chain, remove the middle unnecessary URLS ? Advice please 🙂
Intermediate & Advanced SEO | | BeckyKey0 -
Best SEO Practices for FAQ Page
Hi all, I'm looking for some tips on best practices for FAQ pages. In particular, is it better to have all questions and answers listed on one page, or should each question have its own page - given that there's enough content for it Thanks
Intermediate & Advanced SEO | | brian-madden0 -
From HTTP to HTTPS
Hi We have implemented HTTPS to the our website. Do we need to now redirect the whole site to HTTPS in the HTTACCESS file? Because when you enter the site via a google search or enter the domain directly the site is set to HTTP once we click on a URL on the page it sets it to HTTPS so do we require to redirect from the start? thanks
Intermediate & Advanced SEO | | Direct_Ram
E0 -
Cannot 301 redirect, alternatives?
Hi, the company has changed it's name so now under a different domain. All pages have been 301 redirected on a 1:1 basis apart from the home page. For some reason IT cannot 301 redirect the old home page to the new website home page. At suggestions? Perhaps canonical it? Meantime the old home page copy has been changed to say the company name has changed and a link to the new website. Any help greatly appreciated.
Intermediate & Advanced SEO | | Richard5550 -
Redirect 301 or Canonical.
Hello all, I have a page with a long post title and url path name (more than 70 caracters and 115). This page has many visits but I am changing the SEO website structure according to SEOMOz and forums guidelines so: I WILL CREATE A DUPLICATE PAGE WITH THE SAME INFO. This issue has been marked as an issue in the SEO tools, for long names>70 and url path names>115 My question is which option should I use and you would recommend me? 1. OPTION 1: Ideally I would like to keep the old post, so I should use the canonical tag, but my main concern is if the search engines in terms of SEO, even the canonical has been done, will penalise my SEO as there is still a post with bad SEO optimising, or if this is not the case because I already used the canonical. 2. OPTION 2: Eliminate the post and redirection 301 to the new page to keep the juice. I would prefer option 1, as I keep both post and page, but only if searchengines do not penalise my SEO as they detect a long post name and url path name. Thank you verty much, Antonio
Intermediate & Advanced SEO | | aalcocer20030 -
301 redirect
Hi there, I have some good links pointing to one of my web pages at the moment, however we are just about to launch a new design with new URL structure and I am clear that I need to do a 301 redirect on the URL to the new URL. However, do I keep the old URL live forever? or can I remove it after a while? Kind Regards
Intermediate & Advanced SEO | | Paul780 -
How many pages to 301 Redirect
Hi Mozzers, My site has 11,200 pages indexed in Google and I'm looking to remove some of the lesser content which should probably have been picked up by Panda. However these pages work out to about 1,100 in total and I'm not sure whether to remove these bit by bit or just do it in one fell swoop? Does Google not like a site's indexed pages fluctuating too quickly? Are there any other considerations I should be aware of? Thanks!
Intermediate & Advanced SEO | | panini0