Moz Q&A is closed.
After more than 13 years, and tens of thousands of questions, Moz Q&A closed on 12th December 2024. Whilst we’re not completely removing the content - many posts will still be possible to view - we have locked both new posts and new replies. More details here.
301 redirect hops from non-https and www
- 
					
					
					
					
 It's best practice to minimize the amount of 301 redirect hops. Ideally only one redirect hop. It's also best practice to 301 redirect (or at least canonical) your non-https and/or your non-www (or www) to the canonical protocol/subdomain. The simplest (and possibly the most common) way to implement canonical protocol/subdomain redirects is through a load balancer or before your app processes the request. Both of which will just blanket 301 to the canonical domain/protocol regardless if the path exists or not In which case, you could have: - Two hops. i.e. hop #1 http://example.com/foo to https://example.com/foo, hop #2 https://example.com/foo to https://example.com/bar
- 301 to a 404. Let's say https://example.com/dog never existed, but somebody for whatever reason linked to it (maybe a typo). If I request https://www.example.com/dog, the load balancer would 301 to a 404 page.
 Either scenario above should be fairly rare. However, you can't control how people link to you. Should I care about either above scenario? I could have my app attempt to check if the page exists before forwarding, but that code could be complicated. 
- 
					
					
					
					
 Maybe I'm missing something? You can implement an htaccess rewrite rule (or equivalent for your server stack) using regex/host so that essentially 
 http://example.com/foo OR https://example.com/foo redirect to https://example.com/bar That's the standard approach and serves in one hop. Is there something I'm missing why you're getting into a load balancer etc to accomplish this?P. 
- 
					
					
					
					
 Hello there, I´d suggest you to go for the Option 1: two hops. 
 Google understands well up to 4-5 hops. Matt Cutts said it in these videos:
 Can too many redirects from a single URL have a negative effect on crawling? Is there a limit to how many 301 (Permanent) redirects I can do on a site?Also, I think that setting a 301 to a 404, it would give to GoogleBot mixed signals and there could be some cases where you get some links to that 301->404 page and lost that ones. Best luck! 
 GR.
Browse Questions
Explore more categories
- 
		
		Moz ToolsChat with the community about the Moz tools. 
- 
		
		SEO TacticsDiscuss the SEO process with fellow marketers 
- 
		
		CommunityDiscuss industry events, jobs, and news! 
- 
		
		Digital MarketingChat about tactics outside of SEO 
- 
		
		Research & TrendsDive into research and trends in the search industry. 
- 
		
		SupportConnect on product support and feature requests. 
Related Questions
- 
		
		
		
		
		
		Default Wordpress 301 Redirects of JS and CSS files. Bad for SEO & How to Fix?
 Hi there: We are developers with some digital marketing expertise, but a current issue has us perplexed. An outside SEO firm has asked us to clean up a large number of 301 redirects. Most of these are 'default' Wordpress behavior that relate to calling the latest version of a JS or CSS file. For instance, a JS file is called with this: https://websitexyz.com/wp-includes/js/wp-embed.min.js?ver=4.9.1 but ultimately redirects to this: https://websitexyz.com/wp-includes/js/wp-embed.min.js. We are being asked to prevent the redirect from happening by, presumably, calling the ultimate file to begin with. The issue is that, as far as we know, there's no easy way to alter WP behavior to call the ultimate file to begin with. Does anyone have any thoughts on this? Thanks. Intermediate & Advanced SEO | | Daaveey0
- 
		
		
		
		
		
		Moving html site to wordpress and 301 redirect from index.htm to index.php or just www.example.com
 I found page duplicate content when using Moz crawl tool, see below. http://www.example.com Intermediate & Advanced SEO | | gozmoz
 Page Authority 40
 Linking Root Domains 31
 External Link Count 138
 Internal Link Count 18
 Status Code 200
 1 duplicate http://www.example.com/index.htm
 Page Authority 19
 Linking Root Domains 1
 External Link Count 0
 Internal Link Count 15
 Status Code 200
 1 duplicate I have recently transfered my old html site to wordpress.
 To keep the urls the same I am using a plugin which appends .htm at the end of each page. My old site home page was index.htm. I have created index.htm in wordpress as well but now there is a conflict of duplicate content. I am using latest post as my home page which is index.php Question 1.
 Should I also use redirect 301 im htaccess file to transfer index.htm page authority (19) to www.example.com If yes, do I use
 Redirect 301 /index.htm http://www.example.com/index.php
 or
 Redirect 301 /index.htm http://www.example.com Question 2
 Should I change my "Home" menu link to http://www.example.com instead of http://www.example.com/index.htm that would fix the duplicate content, as indx.htm does not exist anymore. Is there a better option? Thanks0
- 
		
		
		
		
		
		6 .htaccess Rewrites: Remove index.html, Remove .html, Force non-www, Force Trailing Slash
 i've to give some information about my website Environment 1. i have static webpage in the root. 2. Wordpress installed in sub-dictionary www.domain.com/blog/ 3. I have two .htaccess , one in the root and one in the wordpress Intermediate & Advanced SEO | | NeatIT
 folder. i want to www to non on all URLs Remove index.html from url Remove all .html extension / Re-direct 301 to url
 without .html extension Add trailing slash to the static webpages / Re-direct 301 from non-trailing slash Force trailing slash to the Wordpress Webpages / Re-direct 301 from non-trailing slash Some examples domain.tld/index.html >> domain.tld/ domain.tld/file.html >> domain.tld/file/ domain.tld/file.html/ >> domain.tld/file/ domain.tld/wordpress/post-name >> domain.tld/wordpress/post-name/ My code in ROOT htaccess is <ifmodule mod_rewrite.c="">Options +FollowSymLinks -MultiViews RewriteEngine On
 RewriteBase / #removing trailing slash
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule ^(.*)/$ $1 [R=301,L] #www to non
 RewriteCond %{HTTP_HOST} ^www.(([a-z0-9_]+.)?domain.com)$ [NC]
 RewriteRule .? http://%1%{REQUEST_URI} [R=301,L] #html
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule ^([^.]+)$ $1.html [NC,L] #index redirect
 RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index.html\ HTTP/
 RewriteRule ^index.html$ http://domain.com/ [R=301,L]
 RewriteCond %{THE_REQUEST} .html
 RewriteRule ^(.*).html$ /$1 [R=301,L]</ifmodule> The above code do 1. redirect www to non-www
 2. Remove trailing slash at the end (if exists)
 3. Remove index.html
 4. Remove all .html
 5. Redirect 301 to filename but doesn't add trailing slash at the end0
- 
		
		
		
		
		
		New Site (redesign) Launched Without 301 Redirects to New Pages - Too Late to Add Redirects?
 We recently launched a redesign/redevelopment of a site but failed to put 301 redirects in place for the old URL's. It's been about 2 months. Is it too late to even bother worrying about it at this point? The site has seen a notable decrease in site traffic/visits, perhaps due to this issue. I assume that once the search engines get an error on a URL, it will remove it from displaying in search results after a period of time. I'm just not sure if they will try to re-crawl those old URLs at some point and if so, it may be worth it to have those 301 redirects in place. Thank you. Intermediate & Advanced SEO | | BrandBuilder0
- 
		
		
		
		
		
		How do you 301 redirect URLs with a hashbang (#!) format? We just lost a ton of pagerank because we thought javascript redirect was the only way! But other sites have been able to do this – examples and details inside
 Hi Moz, Here's more info on our problem, and thanks for reading! We’re trying to Create 301 redirects for 44 pages on site.com. We’re having trouble 301 redirecting these pages, possibly because they are AJAX and have hashbangs in the URLs. These are locations pages. The old locations URLs are in the following format: www.site.com/locations/#!new-york and the new URLs that we want to redirect to are in this format: www.site.com/locations/new-york We have not been able to create these redirects using Yoast WordPress SEO plugin v.1.5.3.2. The CMS is WordPress version 3.9.1 The reason we want to 301 redirect these pages is because we have created new pages to replace them, and we want to pass pagerank from the old pages to the new. A 301 redirect is the ideal way to pass pagerank. Examples of pages that are able to 301 redirect hashbang URLs include http://www.sherrilltree.com/Saddles#!Saddles and https://twitter.com/#!RobOusbey. Intermediate & Advanced SEO | | DA20130
- 
		
		
		
		
		
		Is it a problem to use a 301 redirect to a 404 error page, instead of serving directly a 404 page?
 We are building URLs dynamically with apache rewrite. Intermediate & Advanced SEO | | lcourse
 When we detect that an URL is matching some valid patterns, we serve a script which then may detect that the combination of parameters in the URL does not exist. If this happens we produce a 301 redirect to another URL which serves a 404 error page, So my doubt is the following: Do I have to worry about not serving directly an 404, but redirecting (301) to a 404 page? Will this lead to the erroneous original URL staying longer in the google index than if I would serve directly a 404? Some context. It is a site with about 200.000 web pages and we have currently 90.000 404 errors reported in webmaster tools (even though only 600 detected last month).0
- 
		
		
		
		
		
		Remove URLs that 301 Redirect from Google's Index
 I'm working with a client who has 301 redirected thousands of URLs from their primary subdomain to a new subdomain (these are unimportant pages with regards to link equity). These URLs are still appearing in Google's results under the primary domain, rather than the new subdomain. This is problematic because it's creating an artificial index bloat issue. These URLs make up over 90% of the URLs indexed. My experience has been that URLs that have been 301 redirected are removed from the index over time and replaced by the new destination URL. But it has been several months, close to a year even, and they're still in the index. Any recommendations on how to speed up the process of removing the 301 redirected URLs from Google's index? Will Google, or any search engine for that matter, process a noindex meta tag if the URL's been redirected? Intermediate & Advanced SEO | | trung.ngo0
- 
		
		
		
		
		
		DNS or 301 Website Redirect
 We are running a marketplace site, so we have thousands of vendors selling their products on our site. Each vendor has a Profile page and we are soon to launch a premium store-front that is white label. Many of these vendors will want to point a custom url to their premium store-front (which is a sub domain of the marketplace) and we are trying to get an understanding of how we should instruct them to point their url in a way that will give the main marketplace site the seo juice. We also want to understand what will show up in the address bar. Will it be their url or our sub domain? Will any of the marketplace seo juice boost their url local listing status? Intermediate & Advanced SEO | | bloomnation0
 
			
		 
			
		 
			
		 
					
				 
					
				 
					
				 
					
				 
					
				 
					
				 
					
				