I am changing my website's URL to improve the SEO. The current sitemap contains URLs like this:
mysite/browse/1 /* 1 is the ID for fashion */ mysite/browse/2 /* 2 is the ID for real estate */
Now I have changed the URLs to the following format:
I have have the code ready to be released along with the new sitemap. If I release the new code, the old URLs would no longer be valid, ie:
mysite/browse/2 would return "404 - page not found".
I believe I have to release the code and submit the new sitemap to Google Search Console. But I believe it would take Google sometime before actually crawling the new sitemap, so during this time, all my old urls which appear in the search result would return "404 - page not found" error.
How can I mitigate this situation?