Efficient way to redirect 1500 urls?

Discussion in 'Apache' started by Dan Morgan, Apr 15, 2010.

  1. #1
    Planning on migrating a site with 1500 pages to a new CMS, and rolling with the punches on changing the URL structure.

    That means I need to ensure existing URL's are 301'ed.

    I've given in to the fact I may need to map the old to the new manually, but what's the best way to make this occur? Stuffing the ht access file with 1500 redirects won't do me many favours will it?

    Thanks.
     
    Dan Morgan, Apr 15, 2010 IP
  2. joebert

    joebert Well-Known Member

    Messages:
    2,150
    Likes Received:
    88
    Best Answers:
    0
    Trophy Points:
    145
    #2
    joebert, Apr 16, 2010 IP
  3. Dan Morgan

    Dan Morgan Peon

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I found out about that today actually - Doesn't it require access to httpd.conf?
     
    Dan Morgan, Apr 21, 2010 IP
  4. joebert

    joebert Well-Known Member

    Messages:
    2,150
    Likes Received:
    88
    Best Answers:
    0
    Trophy Points:
    145
    #4
    Manual says "server" or "virtualhost" context for the RewriteMap directive. So you'd either need to alter httpd.conf/apache2.conf or modify the file your virtual host is stored in if your server handles sites with multiple files.
    I'm guessing that what you're getting at is that you're on shared hosting or otherwise can't modify this file. You said "efficient", you didn't mention we had to keep one hand tied behind our back. ;)

    What about ErrorDocument and catching 404 errors to forward the requests with a script ?

    It doesn't work on all setups, but on a server where you can override the 404 status code within the script defined by ErrorDocument would let you only have the server work on it when one of these URLs actually gets followed, which should slow down over time as the new stuff stabilizes.
     
    joebert, Apr 22, 2010 IP