Welcome to WebmasterWorld Guest from 3.228.21.186

Forum Moderators: Ocean10000 & phranque

Message Too Old, No Replies

301 Redirecting: Have 5 pages, but only 1 page is needed.

     
5:28 am on Nov 13, 2003 (gmt 0)

Full Member

10+ Year Member

joined:June 28, 2000
posts:280
votes: 0



Jim, thanks for your help on things. I now have the following question. Lets say I have the following directory structure:

product/subDirectory/index.html
product/subDirectory/index2.html
product/subDirectory/index3.html
product/subDirectory/index4.html
product/subDirectory/index5.html

and I need to 301 redirect the pages to just this category:

/product/

The twist is that there will be no need for the index2, index3, index4, and index5 pages within the new /product/ category. What should be done with these 4 pages? 301 redirecting these pages would lead to nothing.

Thanks for any help that you can provide.

Bradley

3:27 pm on Nov 13, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


Bradley,

Use mod_rewrite or RedirectMatch to redirect all of those pages to just "/" or to "/index.html" in /product. Either of them can handle that problem quite neatly.

Jim

4:33 pm on Nov 13, 2003 (gmt 0)

Full Member

10+ Year Member

joined:June 28, 2000
posts:280
votes: 0


Okay, I've searched the WebmasterWorld forum for redirectmatch'es and came up with this:

redirectmatch ^/product/subDirectory/ [mysite.com...]

Would this be correct? Does this produce a 301 redirect message for the search engines? In addition, is the " ^ " character needed before /product/subDirectory? Thanks again for your assistance.

4:45 pm on Nov 13, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


The "^" is a special character used in regular expressions [etext.lib.virginia.edu], an extremely powerful pattern-matching language.

More redirect info [httpd.apache.org].

Jim

5:15 pm on Nov 13, 2003 (gmt 0)

Full Member

10+ Year Member

joined:June 28, 2000
posts:280
votes: 0


There was a reason I wasn't a server administrator or programmer! :) This is a little like reading Chinese for me, but I am trying.

From what I read, it seems as if the " ^ " would not be needed in the above example. In doing some more research, would the following example work as well:

redirect 301 /product/subDirectory/ [mysite.com...]

The way I read this is that all pages in the subDirectory folder would get rerouted to the /product/index.html page. Would something like this raise a duplicate content flag though?

6:25 pm on Nov 13, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


Bradley,

Do yourself a favor and use the start anchor... :)

RedirectMatch 301 ^/product/subDirectory/ http://www.mysite.com/product/index.html

> Would something like this raise a duplicate content flag though?

No, because the 301 means "Replace the URL you requested with this one." Smart user-agents will delete the old URL and use the new one... thus no duplication.

Jim