How can I load the JS files from an index file in a different directory

Hello. I have created an MV project and deployed it as an android app. It gives me a directory called 'www' within a directory named after my game; the 'www' directory has an index.html file that calls the required scripts to start the game processing. Now, what I've done is placed this 'www' directory on a website and, using a PHP file in a different directory, I've recreated the html that the index file in the 'www' directory uses to start my game and correctly altered the href of the required script libraries. However, since the PHP file is being run as example.com/php-page, the scripts called from within the RPG Maker MV are inaccessible to the body, where the scripts are placed within the document. I get errors in my console saying can not load resource example.com/php-page/www/js/** . This is obviously because the MV resources are in a directory next to the directory with my php files that construct my content management system and MV resources are calling from a relative path to that of the PHP file. 


My question now becomes, does anyone have an idea how I should go about getting the MV scripts within  to correctly load from a path of my choosing? If it helps, the site is www.guelstie.com, and the game is currently playing off the originally deployed index file within it's own directory on my site at http://www.guelstie.com/games/Tamria. I'm trying to add some security to the game so that you can only play if you're logged in. 
Just put the php file in the same directory as your assets. PHP embeds into HTML very well, so you shouldn't have to proxy it at a different URL. If you really need to mask the URL, I recommend using custom settings in NGINX or Apache (not sure if IIS supports this) to route example.com/php-page directly to your game directory.


KISS. There's no real reason to over engineer.

Original thread: https://forums.rpgmakerweb.com/threads/how-can-i-load-the-js-files-from-an-index-file-in-a-different-directory.56544/