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

.ru/index.php/option/content/task/view/id/301  
.ru/index.php?option=content&task=view&id=301

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

.ru/index.php?option=content&task=view&id=185

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

.ru/index.php/option/content/task/view/id/301

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