Fix links

The site is based on the MySQL database, there used to be an engine and the links in it were something like this


And everything worked, no matter what the link looked like, ID = 301 was opened, but now I changed the engine, now my site opens only links of this kind


But there are sites that have linked to my site like this


What to do? How to get out of the situation? Or how to write it in such a way that .../content/task/...would also work with this method?

Answer 1

Make a replacement for the desired type of url

RewriteRule ^index.php/option/content/task/view/id/([0-9]+)$ /index.php?option=content&task=view&id=$1 [L]

Looks like this