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
-
Hreflang Errors 404 vs "Page Not Found"
For a websites that differ between catalogs (PDPs) what hreflang error causes the least harm? Obviously the best solution is to only have hreflang for shared products, but this takes more work to implement. So when no identical product exists... 1. Hreflang points to 404 or 410 error. 2. Hreflang points to 200 status "Page Not Found" page. This obviously has the additional issue of needing to point back to 100+ urls. I want to avoid having Google decide to ignore all hreflang due to errors as many correct urls will exist. Any thoughts?
On-Page Optimization | | rigelcable0 -
How should we act regarding a 404 that came from a 301?
Hi! Some time ago we changed our domain from canexel.net to canexel.es. We spent some time "cleaning" the backlinks to the ".net" domain since we had been penalized by penguin. After some time we went ahead and did a 301 from .net to .es january 15. From that date on we've noticed that webmaster tools has been detecting a really big increase oon 404 detected on our site. All this 404 come from .net pages that have been cached by google but don't exist anymore. The problem is that the 301 has made google believe that they exist also on our .es site (where of course don't exist either), and 404 have appeared from this non existing pages pinting to other non existing pages. We want to to eliminate the urls from WMT but we don't know if we should eliminate them both from the .net and .es domains or just from the .net one. We also would like to know if this would penalize our SEO. Thanks
On-Page Optimization | | Canexel0 -
Reverse 301 redirect - how will that work?
Hi We have done some testing where we have changed our URL to a new name and 301 redirected the old to the new. It has now been decided to go back to the old url again but is there an seo risk to this? Will all the inbound links that as redirected in the first change be lost or?
On-Page Optimization | | AndersDK0 -
301 rediects - weird characters
Hi, Just cleaning up some 404 errors in my site in GWT and noticed a couple of external links pointing at me that are wrong. Basically they are from a couple of DIY forum sites (I've not put these links in place myself they are 100% natural) and it appears that the owners of the forums amend the links (inserting characters into link) so they are not quite right. How would I go about redirecting the following - www.example.co.uk/blueberry_pie.htm Whatever I try doesn't work and I always end up with a 404! Cheers
On-Page Optimization | | Jon-C
J0 -
Which meta descriptions should I fix first?
Our biggest issue with SEO right now is the lack of meta descriptions. There are a ton of pages that require meta descriptions that we don't know which ones to prioritize first, namely: corporate website pages landing pages for specific content offers that are gated behind a form blog posts Since we can't tackle everything at once, what's best practice around which pages to fix first? Thanks!
On-Page Optimization | | BizoMarketing0 -
Need to hire an SEO consultant to fix my website
Just started using SEOmoz and discovered lots of issues with my site. Need some help. Obviously the person could access my SEOmoz account and make sense of all that is needed. Then either go to my website and fix or tell me what to do. Thanks, Scott
On-Page Optimization | | ecoscott0 -
How much juice do you lose in a 301 redirect?
Our site has a number of, shall we say, unoptimized URLs. I would like to change the URLs to be more relevant; if a page is about red widgets, the URL should be www.domain.com/red-widgets.html, right? I'm getting resistance on this, however, based on the belief that you lose something significant when you 301 an old URL to a new one. Now, I know that if you have a long chain of redirects, the spiders will stop following at some point, and that is a huge problem. That wouldn't apply if there's only one step in the chain, however. I've also heard that you lose some link juice in a 301, but I'm unsure how serious that problem actually is. Is it small enough that we'd win out in the long run with better-optimized URLs?
On-Page Optimization | | CMC-SD0 -
How should I fix my short meta descriptions?
I recently added meta descriptions to several community-supplied pages for our open source website http://spree.tw/N53HuO Google Webmaster Tools is complaining/warning that the meta descriptions are too short. The descriptions are being supplied by our users and they typically do not lend themselves to anything much longer than what is being entered already. I was thinking of adding some text to the end of the meta description. Something like "This is one of many third party extensions for Spree supplied free of charge by our community" or something else like that. Is it acceptable practice to reuse a snippet in your meta description like this? Do you suggest other alternatives? Since meta description doesn't affect page rank can I use terms that I'm trying to rank for on my home page without cannibalizing my link juice? TIA, Sean
On-Page Optimization | | schof0