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 was developing a Joomla site in /new/ which was to replace the Mambo site in the root directory. I thought I put a robots file there to stop bots from crawling the new site, but this is not the case.

The new site has since been moved into the root directory, and the old site has temporarily been moved into /old/

How do I remove all mention of pages under /new/ from Google's index? I know Google Webmaster Tools allows you to remove individual pages, but I don't know if this applies to individual directories also.

Is it quicker to place an .htaccess file in this folder with a catchall 301 redirect to / ?

Update:

I've added individual 301 redirect entries to .htaccess to redirect the old site's pages to the new site's pages, but the old URLs still generate 404 errors. Any ideas why? The format I used was:

Redirect 301 http://www.site.com/old.htm http://www.site.com/new.htm 

I added these at the end of the .htaccess file.

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

Definitely do a 301 redirect from the old URLs (those in the /new/ directory) to the new URLs (those in the / directory). This will:

  • Tell Google those pages have moved and to update their index
  • Help anyone who finds the old URLs in the search results to find the new URLs (they will be automatically redirected to the URL)

This process will be seamless, too, which is nice. And a simple rule in an .htaccess file should take care of it.

UPDATE

Try this:

RewriteEngine On
RewriteRule /new/(.*) /$1 [R=301,L]
share|improve this answer
    
Thanks @John Conde. I added the following to the .htaccess in the root directory: RedirectMatch 301 /new/(.*) / However, it redirects to the same URL, just 1 level up. –  Steve Apr 6 '11 at 15:37
    
Also, RedirectMatch 301 /new/(.*) /index.php does the same thing. –  Steve Apr 6 '11 at 15:39
    
@John Conde. For some reason the new change is still generating a 500 internal server error. –  Steve Apr 7 '11 at 1:10
    
I also tried prepending the entire base URL before /new/ but the same error occurred. –  Steve Apr 7 '11 at 1:13
    
@Steve, I made a minor change. Let me know if that works. –  John Conde Apr 7 '11 at 1:58
show 6 more comments

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.