Forum Moderators: open
Redirect 301 /old_1.html [domain.com...]
Redirect 301 /old_2.html [domain.com...]
Redirect 301 /old_3.html [domain.com...]
Redirect 301 /old_4.html [domain.com...]
...and so on. I also do this with other file types I have replaced and renamed. This list is growing - LOL
Is there a condensed way of doing this to on avoid code bloat? For example, listing the old files that point to the same new one, all in the same redirect? Thanks.
If all your old files have 'old_' in their names - which seems quite unlikely :) - try this:
RedirectMatch permanent ^/old_(.*)\.html$ newURL
A better idea is something like
RedirectMatch permanent (/old_1¦/old_2¦/old_3)\.html newURL
It looks like the forum software replaces my solid vertical bars with ¦ .
If I'm correct, you should use status descriptions, not status codes, with redirect-instructions.
I sincerely hope this helps you (I haven't tested it).
One thing that may help is that you don't need to leave these redirects up permanently. I usually only leave mine up for 6 months or so. Offer a link to your site map on your custom 404 page to provide a last-ditch method to avoid losing visitors to old URLs.
If there is anything common about the old filenames, then RedirectMatch can help. If you use it, be sure to escape the "_" character by writing it as "\_", and replace the broken vertical pipes with solid ones as RonPK notes.
Jim