301 redirect for some files

Discussion in 'Site & Server Administration' started by Ajeet, May 4, 2006.

  1. #1
    Hi,
    Can the following be done: I have 1000 files on a subdomain which I need to redirect to my new domain. But, I only care for 10 of the old files pointing to their corresponding counterparts. The remaining 990 files should just redirect to the index page of the new domain. Is there ONE command that would redirect the remaining 990 files?

    I am looking at something like:

    
    redirect 301 /oldfilename1.html http://www.newdomain.com/newfilename1.html
    .
    .
    .
    redirect 301 /oldfilename10.html http://www.newdomain.com/newfilename10.html
    
    redirect 301 /*.html http://www.newdomain.com/
    
    Code (markup):
    In other words, can I file-by-file redirect some files, but mass-redirect all the rest?

    Thanks
    Ajeet
     
    Ajeet, May 4, 2006 IP
  2. theblight

    theblight Peon

    Messages:
    246
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Yes you can and you can!

    and also you can use Nintendo's howto on redirection as reference

    mod_rewrite
     
    theblight, May 5, 2006 IP
  3. Ajeet

    Ajeet Well-Known Member

    Messages:
    2,511
    Likes Received:
    503
    Best Answers:
    0
    Trophy Points:
    185
    #3
    All I can say is WOW. I went through the original post you linked to and a dozen of the follow ups. I guess I must be really code-deaf, as I am in no better position :(

    But, you are saying that there can be a redirect command that would redirect 990 of my 1000 files to a common destination, right?

    Thanks
     
    Ajeet, May 5, 2006 IP