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
-
301 Redirect chain
I've got a redirect chain happening
On-Page Optimization | | Libra_Photographic
http > https> https.www. I can't find how to fix this one. My site is on siteground which forces the https at server level and then onto cloudflare. Anyone have any ideas?0 -
Is it better to shorten my existing url to use only keyword after domain with a 301 redirect from existing url
I have a long existing URL that has included my key word but the url has about 5 additional words in the text ( eg url would have " /super widgets in stock at the widget store " as url text after domain. keywords is super widget The URL was at the top of search results for my keyword for many years until recently. Is it better to shorten my url text to now use only my keyword " /super-widgets " after the domain with a 301 direct from my existing url to optimize it Thanks
On-Page Optimization | | mrkingsley2 -
How to fix Medium Priority Issues by mozpro crawled report??
How to resolve this issues crawled by mozpro?
On-Page Optimization | | renukishor
Some Medium priority issues like that: Missing Meta Description Tag: 2669
Title Element is Too Long: 523
Duplicate Page Title: 37 How to add missing meta description tag in these pages and how to short title element ?0 -
404 errors on page urls that don't even exist
The Seomoz crawler found 404error of pages dont even exist. Ho can that be possible?? Pages like: URL: http://www.yoxo.it/catalog/seo_sitemap/category/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/falli/
On-Page Optimization | | yoxo0 -
404 crawl errors with all url+domain
We have 187 crawl 404 errors. All urls on web make a 404 error that this http://www.domain.com/[.....]l/www.domain.com all errors added to the url, the url domain I put an example gestoriabarcelona.com/www.gestoriabarcelona.com
On-Page Optimization | | promonet
gestoriabarcelona.com/tarifas/www.gestoriabarcelona.com
gestoriabarcelona.com/category/noticias/page/7/www.gestoriabarcelona.com
gestoriabarcelona.com/2012/08/amortizacion-de-unaconstruccion/
www.gestoriabarcelona.com
[..] I don't know where can i find to solve errors Anyone can help me? Thanks0 -
Fixed horrible title tag on home page, and lost ranking. Will it come back?
I was helping out someone on their site and its home page ranked on page 2 for their term, and the title tag was horrible. It was 160 characters long with lots of near repetitive keywords ([keyword] - adjective [keyword] - adjective [keyword] - adjective [keyword] etc.) -- typical title that Google would penalize when it got around to it. So I created a title that made sense, for the keyword, and that followed the best practices of Google recommendations. Now it's dropped off the index. (EDIT: sorry, still in index, just not even in top 1000) Is this something I should not have done? I was just trying to keep them from getting slammed. And, how long should I expect it to take to get my ranking back? This is the only page title I changed.
On-Page Optimization | | bizzer0 -
301 internal redirects
Hello, I have a lot of low quality pages on my site, many of which have very similar URLs and cover similar topics. I want to tidy up my site by using 301 redirects as Rand suggests here: http://www.seomoz.org/blog/how-to-solve-keyword-cannibalization 1. As a rough rule of thumb, how many internal 301 redirects is too many? 2. Can lots be to the homepage if they're relevant? (I could have as many as 30) Thanks, Kevin
On-Page Optimization | | KMack0 -
Canonical URL's - Fixed but still negatively impacted
I recently noticed that our canonical url's were not set up correctly. The incorrect setup predates me but it could have been in place for close to a year, maybe a bit more. Each of the url's had a "sortby" parameter on all of them. I had our platform provider make the fix and now everything is as it should be. I do see issues caused by this in Google Webmaster, for instance in the HTML suggestions it's telling me that pages have duplicate title tags when in fact this is the same page but with a variety of url parameters at the end of the url. To me this just highlights that there is a problem and we are being negatively impacted by the previous implementation. My question is has anyone been in this situation? Is there any way to flush this out or push Google to relook at this? Or is this a sit and be patient situation. I'm also slightly curious if Google will at some point look and see that the canonical urls were changed and then throw up a red flag even though they are finally the way they should be. Any feedback is appreciated. Thanks,
On-Page Optimization | | dgmiles
Dave0