Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I want to redirect specific URLs to the index page not to 404 error page (ex: http://www.website.com/trip-15).

If I remove any character from the URL it will go to 404 error page (ex: http://www.website.com/trip-1).

I want to redirect it to the index page. Any help?

share|improve this question
    
What have you tried? –  John Conde Jun 9 '13 at 14:34
    
Don't do that. If you can't find something, then say you can't find it (which is what 404 means), don't say that whatever they were looking at can be found on the homepage. It isn't what people expect to happen, and it makes it really hard to fix typos or copy/paste errors. –  Quentin Jun 10 '13 at 6:17

2 Answers 2

up vote 0 down vote accepted

Redirecting all mistyped URLs to the homepage isn't generally best practice. This is why we have 404 pages - to tell users that they've landed on a non-existent page. Instead, here are a few tips:

  1. Make your 404 page friendly and useful. Don't make users feel like they've done something wrong, but make it REALLY easy to get where they want to be. Give them a search box, and maybe some links to your most popular pages. If your site is really smart, take what's been typed in as a URL and display some "you typed this, did you mean that?" suggestions.
  2. Regularly review Crawl Errors in Google Webmaster Tools. This shows you pages that Google has found that don't work (404, 500, etc) and help you identify where these links might be coming from. You may be able to get 3rd parties to fix their links.
  3. Use your list of 404 Crawl Errors to determine which individual pages to 301 redirect. So if you see references to "/tirp-15" you can 301 that to "/trip-15" and actually get users where they want to be.

This may be a bit more work than just mass-redirecting everything, but on an ongoing basis it'll lead to a much better user experience AND ranking for your pages overall.

share|improve this answer

Nice question, its common to have URL and we wish to have redirect the wrongly typed URL to your home page. I need little more information which CMS or platform you are using, it may be vary according to the server you are using, and i found the site where you can do set your costume error message or site setting to generate the code for your error.

http://www.htaccessredirect.net/ you can visit as per your quarry, i think you want to redirect the pages from 404 page to your home page right. its not about wrong/mistyped URL its about URL which is not in your site, so here is code i could generated that you can enter in your .htaccess file

//Custom 404 errors ErrorDocument 404 http://yoursitename.com/index.html

I hope this will help you.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.