CodeIgniter Forums
Easy way to handle alot of redirects - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Easy way to handle alot of redirects (/showthread.php?tid=34961)



Easy way to handle alot of redirects - El Forum - 10-15-2010

[eluser]patrick24601[/eluser]
I am completely rewriting a website that had thousands of pages on it. It was a Yahoo store, and every product was generated as it's own HTML page.

I have turned on logging in CI and I see quite a few 404 error messages. Since there was a naming pattern in the URL of the old pages I can write business rules in PHP as to how to redirect these pages to the correct new location, or to a search page.

Has anybody had to do this before? Is there a best practice or some sample code someplace? I'd like to avoid creating several thousand 301 redirect entries if possible.

Thanks in advance for your help.