0

I'm having a TON of error pages according to Google. Checking them tells me that about 95% or so go into a subfolder (/test123/). That subfolder doesn't exist anymore, and I can't figure out where Google gets the data from, so I would just like to reroute ANYTHING that goes into that subfolder (whatever lies ahead, files and or subfolder structure) to just simply reroute to the home page.

How do I do this? (Or please suggest anything else if that would solve my problem..)

Thanks.

Ok, so it's supposed to be a 301 redirect. Thanks to google I found a few things.. I just would like to know, if the following would be correct:

Redirect 301 /test123/ http://domain.com/

or maybe even:

Redirect 301 /test123/ /
Malachi
  • 977
  • 6
  • 16
  • 31

1 Answers1

0

Answer to first question:

Use a 301 permanent redirect if the page is gone. You should do this ANY time you remove any resource from your site or google will penalize you for any links.

Apache: You can use a redirect or mod_rewrite with [L,R=301]

IIS (stack answer): How to redirect a URL path in IIS?

Nginx (stack answer): How to redirect a url in NGINX

You could create the folder and put an index.html in it with an http redirect in the page by copying this into the of a page but this is not recommended vs a real 301 http response.

Answer to your second question:

There are a few questions you need to ask. First, redirecting 404s is primarily an SEO issue, so you'll want to read about 404s and SEO. See here for some additional info: http://www.seomoz.org/learn-seo/http-status-codes

The first thing you'll likely want to do is analyze why the page is missing and asking if the traffic is recoverable/rebuildable and if the effort in doing something other than redirecting to your home page will add benefit. I'm guessing if this is just some sort of test link then you don't really care, otherwise you may want to redirect to some relevant related content.

If you're asking about the semantics of actually creating a redirect, you'll want to stick the rule in a virtual host block if you're using one for example.

Is there a trailing slash on the requests? these are not equivalent.

Redirect 301 /test123/ http://domain.com/ 
Redirect 301 /test123 http://domain.com/ 

If you actually want a 404 you should use a real 404 error page:

ErrorDocument 404 /Lame_excuses/not_found.html 
Community
  • 1
  • 1
JasonG
  • 5,794
  • 4
  • 39
  • 67