Forum Moderators: phranque

Message Too Old, No Replies

How do I 301 an entire directory to one page

avoiding Google marking deleted pages as Supplemental

         

steveb

12:56 am on Sep 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A site of mine has gone awol from Google due to their &filter=0 fiasco. While it is likely I can't do anything about it, I've identified a few possible steps to improve things, but the possible steps work against themselves.

My main (ignorant-of-Apache) question: can I redirect fifty pages from a subdirectory to a new single page, rather than have to put 50 entries into htaccess redirecting each page?

I know I can do:
RedirectMatch permanent ^/dir1/subd1/$ http://www.example.com/dirA/
RedirectMatch permanent ^/dir1/subd2/$ http://www.example.com/dirA/
RedirectMatch permanent ^/dir1/subd3/$ http://www.example.com/dirA/
...
RedirectMatch permanent ^/dir1/subd50/$ http://www.example.com/dirA/

But can I use just one link to get everything in /dir1/ to go to the index page of /dirA/?

Basically I want to delete fifty pages, but I don't want to:
1 have fifty htaccess entries
2 have fifty pages go 404 and because they will eventually go Supplemental, and Google will still count them and won't see them as "deleted"

At the same time, I will leave up a page linking to the old /subd1/ etc pages so Google crawls the links, sees the 301, and then decides my site is now 50 pages smaller.

jdMorgan

12:59 am on Sep 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just leave off the stuff past /dir1/ including the end-anchor, and it will do what you want:

RedirectMatch 301 ^/dir1/ http://www.example.com/dirA/

Jim

steveb

1:15 am on Sep 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks, Jim. The $ thingee threw me off.