I am currently in a project with a PHP frontend. We\'re pretty concerned about security, because we\'ll have quite a lot of users and are an attractive target for hackers. O
You can use your current solution and add iframes with different base URLs to show the contents. Changing the base URL on the iframe will disable access from the internal JavaScript code to the main page. That is, if your URL is http://www.yoururl.com/thread/500 you can use it in the iframe to show content, something like: http//yoururl.com/thread/500/coment/1, http//yoururl.com/thread/500/coment/2.
The base URL you can set can be dependent on your DNS/host configuration.
It's not a solution to fix the problem but to jump it over, although it can be useful until you find something else.