Error Document 301
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of 404 redirect htaccess this site About Us Learn more about Stack Overflow the company Business Learn
How To Redirect 404 Error Page To Homepage In Php
more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question
404 Redirect To Homepage
x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up
How To Redirect 404 Error Page To Homepage In Html
How to use Errordocument 404 with 301 in header? up vote 1 down vote favorite 1 I have a dynamic content website and I want to redirect all non existed pages to index page but with the header showing 301 permanent redirect and not the 404 error. I know that I can redirect with .htaccess Errordocument 404 /index.php But this will have the 404 404 redirect wordpress status in the header, and I'd rather the header to show a 301 redirect. Is this possible? .htaccess redirect http-status-code-404 share|improve this question edited Sep 2 '12 at 16:21 hammar 112k9227334 asked Sep 2 '12 at 16:14 AMB 32312152 1 Why would you want your website to show a 301, instead of a 404. 404 means that the page can not be found. That's exactly the situation you are describing. –Kevin Johnson Sep 2 '12 at 16:19 the thing is thousands of pages are created and removed daily from site so i dont want to loose focus of the surfer by sending them to error page. –AMB Sep 2 '12 at 17:43 The surfer doesn't care about the 404 status in the header... –Kevin Johnson Sep 2 '12 at 20:14 add a comment| 1 Answer 1 active oldest votes up vote 3 down vote accepted First of all, you shouldn't. If some content is not found, the server should return 404; you should only return 301 only if the content has been moved. That said, it's possible, using the mod_rewrite module. RewriteCond %{REQUEST_FIL
Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn how to redirect 404 error page in php more about hiring developers or posting ads with us Server Fault Questions Tags Users Badges how to redirect 404 error page to homepage in wordpress Unanswered Ask Question _ Server Fault is a question and answer site for system and network administrators. Join them; it only takes a how to redirect 404 error page wordpress minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top Can I make Apache ErrorDocument return 404 instead of 301? up vote http://stackoverflow.com/questions/12237579/how-to-use-errordocument-404-with-301-in-header 1 down vote favorite In my .htaccess I have ErrorDocument 404 http://foo.com/404.html It works, in the sense that I recover from any file not found error and show the 404 page instead, but the way it works is to redirect the erroneous URI using a 301 to my 404.html page. This is bad because search engines and crawlers will not end up seeing a 404 code, rather a 301 code and will not purge deleted pages from http://serverfault.com/questions/646668/can-i-make-apache-errordocument-return-404-instead-of-301 their indices. Can I make Apache serve up the contents of this 404 page upon file not found errors, yet still return a 404 code instead of the 301? apache-2.2 .htaccess http-status-code-404 301-redirect errordocument share|improve this question asked Nov 24 '14 at 15:01 coneybeare 226312 add a comment| 2 Answers 2 active oldest votes up vote 3 down vote accepted You should try to use absolute or relative path and not an URL My apache2.conf : ErrorDocument 403 /error/403.html ErrorDocument 404 /error/404.html ErrorDocument 500 /error/500.html share|improve this answer answered Nov 24 '14 at 15:06 Maxence 8319 add a comment| up vote 3 down vote Don't point at an external url Apache's docs say: The syntax is, ErrorDocument <3-digit-code>
404 Error Pages and Redirects for SEOs Introduction A 404 error means "not found". This is usually the page you get when you make a mistake spelling page name in a site, or if the page is deleted or moved. The problem is that the http://www.mcanerin.com/en/articles/301-redirect-404-error.asp standard 404 page is ugly and unhelpful. Many people have figured out that if you use http://docs.aws.amazon.com/AmazonS3/latest/dev/CustomErrorDocSupport.html a custom 404 page you can present a much more helpful page to you visitors. Others have taken it a step further and made that custom page a redirect to the home page, so that any links (and PR) pointing to pages that have been deleted (or misspelled) will be passed on to the website. Sounds great, right? Well, there is a problem (there is how to almost always a problem with things that sound too good to be true...). The problem is that if you use a redirect to pass PR from an error page to a normal page, the redirecting page will usually return a "200 OK" or 302 Redirect code, rather than a proper 404. This messes up search engines and can result in a whole bunch of indexed URL's all looking to the search engine like duplicates of your home page (there is no redirect how to redirect code, it's a pure 200 OK). "410 Gone" Error - It's Gone, Dammit! If you are really, really insistent on a page being removed, you can send a "410 Gone" error for the location, which means that the page is not there, will never be there, and there is no forwarding address. This usually isn't necessary, but can be useful if you are trying to remove all traces of a page you no longer want associated with your site (i.e. one you were sued over, for example). It says that the page is missing on purpose, and is not an accident or temporary problem. In this case a URL removal Request to Google followed by a 410 on the page location itself should do it. You can also use robots.txt and robots metatag as backup. This is bad for your site. Additionally, there are a LOT of indexed "error" pages in search engines (especially Yahoo) that should not be there. The proper behaviour for an error page is to return a 404 error code. The best result for your visitors is an error page that is either helpful by itself or redirects to a helpful page. The best result from an SEO viewpoint is for any link popularity for broken links be passed on to the page of your choice. Naturally, the best result overall would be something that accomplishes all of the above. Unfortunately, this is not directly possible. As soon as t
Guide (API Version 2006-03-01)Entire SiteAMIs from AWS MarketplaceAMIs from All SourcesArticles & TutorialsAWS Product InformationCase StudiesCustomer AppsDocumentationDocumentation - This ProductDocumentation - This GuidePublic Data SetsRelease NotesPartnersSample Code & LibrariesWhat Is Amazon S3?IntroductionMaking RequestsMaking Requests over IPv6Using Dual-Stack EndpointsMaking Requests Using the AWS SDKsUsing AWS Account or IAM User CredentialsMaking Requests Using AWS Account or IAM User Credentials - AWS SDK for JavaMaking Requests Using AWS Account or IAM User Credentials - AWS SDK for .NETMaking Requests Using AWS Account or IAM User Credentials - AWS SDK for PHPMaking Requests Using AWS Account or IAM User Credentials - AWS SDK for RubyUsing IAM User Temporary CredentialsMaking Requests Using IAM User Temporary Credentials - AWS SDK for JavaMaking Requests Using IAM User Temporary Credentials - AWS SDK for .NETMaking Requests Using AWS Account or IAM User Temporary Credentials - AWS SDK for PHPMaking Requests Using IAM User Temporary Credentials - AWS SDK for RubyUsing Federated User Temporary CredentialsMaking Requests Using Federated User Temporary Credentials - AWS SDK for JavaMaking Requests Using Federated User Temporary Credentials - AWS SDK for .NETMaking Requests Using Federated User Temporary Credentials - AWS SDK for PHPMaking Requests Using Federated User Temporary Credentials - AWS SDK for RubyMaking Requests Using the REST APIVirtual Hosting of BucketsRequest Redirection and the REST APIBucketsRestrictions and LimitationsExamples of Creating a BucketDeleting or Emptying a BucketBucket Website ConfigurationUsing the AWS Management ConsoleUsing the SDK for JavaUsing the AWS SDK for .NETUsing the SDK for PHPUsing the REST APITransfer Accelerati