redirect old php urls to new flask urls
If using apache, putting rewrite rules into either the directory section of the httpd.conf file or into an .htaccess file would probably be the easiest way to do this.
I had a website which was written in php containing urls such as example.com/index.php?q=xyz .
Now I have rewritten it in flask ( python ) which has urls such as example.com/search?q=xyz .
What is the best way to do it? 
One approach I think of is to write an index.php and code in php to redirect. But is it possible achieving same thing using application ( flask) only?
Update: sending parameters are not exactly same, there is some customization with that too.