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
-
Redirect Chains
Hi There, I have had conducted a few migrations recently and have a common issue which is this: HTTP (old site) -> HTTPS (old site) -> (HTTPS) (new site) Which causes a redirect chain. How should you prevent this before migration or fix it after migration? Cheers.
Intermediate & Advanced SEO | | kayl870 -
Best practice to consolidating authority of several SKU pages to one destination
I am looking for input on best practices to the following solution Scenario: I have basic product A (e.g. Yamaha Keyboard Blast) There are 3 SKUs to the product A that deserve their own page content (e.g. Yamaha Keyboard Blast 350, Yamaha Keyboard Blast 450, Yamaha Keyboard Blast 550) Objective: - I want to consolidate the authority of potential links to the 3 SKUs pages into one destination/URL Possible Solutions I can think of: - Query parameters (e.g /yamaha-keyboard-blast?SKU=550) - and tell Google to ignore SKU query parameters when indexing Canonical tag (set the canonical tag of the SKU pages all to one destination URL) Hash tag (e.g. /yamaha-keyboard-blast#SKU=550); load SKU dependent content through javascript; Google only sees the URLs without hashtag Am I missing solutions? Which solutions makes the most sense and will allow me to consolidate authority? Thank you for your input.
Intermediate & Advanced SEO | | french_soc0 -
Redirecting 404 pages
Hello,We have a wordpress site that has some "hidden" pages with weird URL's. Due to the way the site was built (not by us) if we setup our standard practice for 404 pages some site functionality will be lost.Standard Practice for 404's www.domain.com/fafsaf shows 404 error pageProposed solution:- www.domain.com/safaf >forwards to> www.domain.com/404 - shows 404 error page. Will this stop the search engines indexing the pages? - we have also amended the robots.txt to try and stop some pages being indexed but we still keep finding the odd little "hidden" page.The aim is to try and get all the search engines just to index the few simple pages on the sitemap instead of finding all these extra pages.
Intermediate & Advanced SEO | | JohnW-UK0 -
What's the best way to redirect categories & paginated pages on a blog?
I'm currently re-doing my blog and have a few categories that I'm getting rid of for housecleaning purposes and crawl efficiency. Each of these categories has many pages (some have hundreds). The new blog will also not have new relevant categories to redirect them to (1 or 2 may work). So what is the best place to properly redirect these pages to? And how do I handle the paginated URLs? The only logical place I can think of would be to redirect them to the homepage of the blog, but since there are so many pages, I don't know if that's the best idea. Does anybody have any thoughts?
Intermediate & Advanced SEO | | kking41200 -
Worpress Redirect
I am migrating a WP site from one domain to another for a client. WP is installed at the root. Typically I would simply issue a 301-redirect for the entire domain, however, in this case, the client wants the content in 2 specific subfolders to remain live on the old site and have everything else redirected. Example: olddomain.com/subfolder-1/ olddomain.com/subfolder-2/ Question: what would the the htaccess code look like to pull this off? Thanks!
Intermediate & Advanced SEO | | SCW0 -
Best practice to disavow spammy links
Hi Forum, I'm trying to quantify the logic for removing spammy links.
Intermediate & Advanced SEO | | Mark_Ch
I've read the article: http://www.seomoz.org/blog/how-to-check-which-links-can-harm-your-sites-rankings. Based on my pivot chart results, I see around 55% of my backlinks at zero pagerank. Q: Should I simply remove all zero page rank links or carry out an assessment based on the links (zero pagerank) DA / PA. If so what are sensible DA and/or PA metrics? Q: What other factors should be taken into consideration, such as anchor text etc.0 -
What is the best practice to optimize page content with strong tags?
For example, if I have a sub page dedicated to the keyword "Houston Leather Furniture" is it best practice to bold ONLY the exact match keyword? Or should ONLY the words from the keyword (so 'Houston' 'Leather' and 'Furniture') Is there a rule to how many times it should be done before its over-optimization? I appreciate any information as I want to do the BEST possible practice when it comes to this topic. Thanks!
Intermediate & Advanced SEO | | MonsterWeb280 -
Mobile Sitemap Best Practices w/ Responsive Design
I'm looking for insight into mobile sitemap best practices when building sites with responsive design. If a mobile site has the same urls as the desktop site the mobile sitemap would be very similar to the regular sitemap. Is a mobile sitemap necessary for sites that utilize responsive design? If so, is there a way to have a mobile sitemap that simply references the regular sitemap or is a new sitemap that has all urls tagged with the "" tag with each url required?
Intermediate & Advanced SEO | | AdamDorfman0