I have a pretty big question and answer system which runs on PHPBB. I have already migrated all the questions and corresponding answers including all the user accounts. I have written my own custom scripts and SQL queries after studying the database structure of PHPBB to do all these stuffs. Already imported more than 3lakhs of questions and their answers. Right now I want to set up a 301 redirect for the new system. PHPBB system is already having a good ranking in SEO. I want to keep it. Please share your views, ideas to handle this situation. .htaccess dynamic 301 won't be a good idea since some URLs doesn't match. So I need to do something with PHP. What are the possible ways ?