AEM dispatcher - Ignore pages after particular page location
I have a component - The component is loading a third-party script and it has many links as child pages. I need to ignore any URL after the mentioned page-path in AEM and allow the third-party script to take control of navigation and URL formation afterwards.
So, I need to ignore any URL after the specified page-path in order not to throw 404s from web-server.
I am using AEM dispatcher and need help as if where this code should be added (as we don't have any .htaccess file). I have tried adding it in dispatcher.any file. But, it doesn't work.
E.g., URL is : https://domain-website/test-page/<anything-after-this-needs-to-be-ignored>
<Directory "domain-website/en/test-page">
Options +FollowSymLinks
IndexIgnore *
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.html
</Directory>
Also, I have the below code in my dispatcher.any file (It's present in WKND project as well)
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
Please help as if where should I add the required code and how it can be achieved in AEM. Thanks for the help!