I have a situation where I have categories and items within a category. Every item has a CMSMS page coupled to it, where different items can link to the same CMSMS page.
I have created a module and registred some routes, like so:
"http://cmsms.localhost/category/item/1
"http://cmsms.localhost/category/item/2
"http://cmsms.localhost/category/item/3
These pages flow through an action in my module called 'redirecttoitem'. This action allows me to first do something specific for the item id (like sending an email for item 3, doing a DB insert for item 1, etc).
Say for example that item 1 and item 2 link to CMSMS page "http://cmsms.localhost/mypage.
How can I get the HTML that would otherwise be outputted when I visit "http://cmsms.localhost/mypage, and have it outputted when I visit "http://cmsms.localhost/category/item/1?
Right now, in my 'redirecttoitem' action, I do header('Location: '.$url) to redirect to "http://cmsms.localhost/mypage. This is close to what I want, but not exactly. With this method, the URL in the browser is changed.
I want the URL in the browser to read "http://cmsms.localhost/category/item/1 and have the page be that of "http://cmsms.localhost/mypage.
How to achieve this? It seems so simple

Thanks in advance.
With kind regards,
Jurrie