How do I fix a 404 with a 301
-
I understand the need for fixing 404's but I have yet to have a serious walkthrough of how to set up a 301. From all the talk on the forums and such I'm pretty sure this is easy but I've just never done it before and I could really use a walk through.
Thanks
-
Hi Ben,
Did one of these responses answer your question for you? If not, also let us know if you're running anything like Wordpress or Drupal, and we can help give you more specific answers.
-
-
Hi Ben,
You probably want to redirect a single page if it is going to a 404. In which case you probably just want add code into the header of the problem page. Whilst you are at it, it might be worth checking that your non-www. pages are forwarding to the www versions. (http://exampledomain.com -> http://www.exampledomain.com)
PHP Redirect
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.exampledomain.com" );
?>Htaccess 301 Redirect (non-www. to www.)
Options +FollowSymLinks RewriteEngine On
RewriteBase / RewriteCond %{HTTP_HOST} !^www.exampledomain.com$ [NC] RewriteRule ^(.*)$ http://www.exampledomain.com/$1 [R=301,L]Custom 404 Page
I would also suggest a custom 404 page with links to your most popular pages, search and a back button.
Hope this helps.
C
-
I use .net when i build sites, iuse the Application_Error method to see if the error was a 404 tthen 301 to my home page. so any broken link 301 to my home page
-
404 error is rendered when the resource requested is not found. You can do 2 things:
- Implement 301 redirect to the new resource if it is related. The kind of redirect will depend upon the type of server your website is hosted on.
- If 301 redirect is not possible on all the pages (it's understandable), a custom 404 page is a worthy option. It will avoid unnecessary loss of visitors from your site as they tend to get pissed with the default 404 page. It will not only help you retain the visitors but also redirect them to the important pages of your website. E.g.Custom 404 Page
Hope it helps.
Regards
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 redirection non-English keyword points to English language pages
We had multilingual website on .co.uk domain and somewhere in April, we've done 301 redirection from domain1.co.uk pages which were in Polish language to domain2.com/pl domain and now for some Polish keywords Google SERP sometimes shows English pages (.com) and sometimes polish pages (.com/pl). Previously co.uk/en had English content and that got redirected to .com. What could be the reason? Thank you for all responses.
On-Page Optimization | | Optimal_Strategies0 -
Weird 404 Error URL's - Where to redirect?
For some reason, I end up with a bunch of weird 404 error URLs like these. /KRVWZ/SVfSZ/ /wp-content/upl /MKWTZ/RKYQZ/ /wp-content/upload What should I do with them? Should I redirect them or is there a better way to do something with them. I do use Yoast Premium if that makes a difference. Thanks in advance.
On-Page Optimization | | photoseo10 -
301 vs. keeping identical URL
Hey everybody! I have a question pertaining to our redesign. The situation is as follows: /drug-rehab/alcohol-withdrawal-los-angeles gets a decent amount of views on out website, and we would like it to be on our redesigned site. I was curious what impact, if any, I would see given the two scenarios below. 301 to /alcohol-withdrawal make the new page /drug-rehab/alcohol-withdrawal-los-angeles as well The second situation is that there are a serious of other pages which don't seem to be of drastic benefit, which I don't feel NEED to be on the website. For example: /post-acute-alcohol-withdrawal-treatment/drug-los-angeles /rehabs-resources/drug-abuse/sub-acute-alcohol-withdrawal etc It appears to me that the content on these pages is rather similar, and I feel like they don't really say anything special. Can I 301 them to the new page? Should I let them die in the black hat inferno they were made in? Any thoughts are greatly appreciated! Thanks guys!
On-Page Optimization | | HashtagHustler0 -
How Can I Fix Adobe Bridge Photo Galleries and Duplicate Content?
I have used the Adobe bridge program for a number of photo galleries on a remodeling site and it is showing a large amount of duplicate titles, etc. Is there an easy fix to this? anyone?
On-Page Optimization | | DaveBrown3330 -
Dealing with thin content/95% duplicate content - canonical vs 301 vs noindex
My client's got 14 physical locations around the country but has a webpage for each "service area" they operate in. They have a Croydon location. But a separate page for London, Croydon, Essex, Luton, Stevenage and many other places (areas near Croydon) that the Croydon location serves. Each of these pages is a near duplicate of the Croydon page with the word Croydon swapped for the area. I'm told this was a SEO tactic circa 2001. Obviously this is an issue. So the question - should I 301 redirect each of the links to the Croydon page? Or (what I believe to be the best answer) set a rel=canonical tag on the duplicate pages). Creating "real and meaningful content" on each page isn't quite an option, sorry!
On-Page Optimization | | JamesFx0 -
How to fix duplicate issue among multiple root domains
Hello, I’m doing SEO for one E-commerce website which name is Lily Ann Cabinets & I’ve around 300 different root domains which having same linking structures, same design & even same product database for all 300 websites, but currently I’m focusing only on Lily Ann Cabinets website & trying to get ranking on some targeted keywords, but website is not performing well in Google.com For Example: http://www.lilyanncabinets.com/ (Main Websites)
On-Page Optimization | | CommercePundit
http://www.orlandocabinets.com/
http://www.chicagocabinets.org/
http://www.miamicabinets.org/
http://www.newyorkcabinets.org/
http://www.renocabinets.org/ So please can anyone tell that Will it create duplicate issue in search engines or may be due to this reason website doesn’t have good ranking in search engines, then how can I fix this issue? Do I have to make different structures for Lily Ann Cabinets?0 -
Pages that show in Open Site Explorer that show as 404's in search
When I use Site Explorer to find our Top Pages there are a whole series of pages like this: http://www.nile-cruises-4u.co.uk/mybestbets/mybestbets-culture.html which I think were created when we had a Bulletin Board on the site. Although they are showing in the Top Pages results when you visit the page you get the following error message: HTTP Error 404.0 - Not Found The resource you are looking for has been removed, had its name changed, or is temporarily unavailable. What implications result from these pages still showing in results and what action should we take without messing up our search rankings? Any advice would be gratefully received.
On-Page Optimization | | NileCruises0 -
Should I fix 302 redirects?
I have a Magento ecommerce site that allows customers to compare products. When SEOmoz crawled the site, it came back with over 6,000 302 redirect errors related to the compare products feature. Is this harming our rankings? And any suggestions on the best way to fix it?
On-Page Optimization | | AmazingPlans0