I am running Modx 3.2.0 on an Apache server (Hostinger) with PHP 8.4. It is a development environment, so my site is in a subdirectory (/bandfg).
It is a bi-lingual site with two Contexts: ‘web’ for English (‘en’) and ‘mak’ for Macedonian (‘mk’). I am using LangRouter for the routing and Babel to link the pages.
Everything is working perfectly.
However, I wanted to use a piece of software that is not a Modx Extra, and it needs its PHP files to be held in a folder similar to ‘assets’, with a piece of HTML in the appropriate resource to execute it. For this, I had to create a /mk subdirectory under /bandfg - i.e. /bandfg/mk - to hold the PHP files so that they were available for the ‘mak’ context.
Again, everything is working perfectly … with one exception.
When I attempted to link to the ‘mak’ home page, I got a 403 error. This was fixed by copying into the /mk subdirectory index.php and config.core.php, and editing index.php to initialise ‘mak’ rather then ‘web’. However, I still have a problem, because instead of presenting the ‘mak’ home page (resource number ‘2’), it presents the ‘web’ home page (resource number ‘1’).
The workaround is to set the ‘mak’ site_start parameter to something other than ‘2’. Linking to the Macedonian home page from within the menu system now presents the correct page, but under the URL {mywebsitename}/bandfg/mk/index.html.
However, if someone should try to link to the site from outside by specifying the URL {mywebsitename}/bandfg/mk, they will be presented with the English (‘web’) home page rather than the Macedonian one (‘mak’).
Even if I go into the manager, bring up resource ‘2’, and click on [View], it presents me with the ‘web’ home page (resource ‘1’).
Intuitively, I would have assumed that when the system gets the URL {mywebsitename}/bandfg/mk it would look to see if there is a /mk subdirectory and, finding that there is, check for the existence of index.php and config.core.php, which it does; and we know that because if either of them is absent we get an error message. So, finding index.php in /mk, it would then execute that file, which initialises the ‘mak’ context, and it would then go to the site_start resource for ‘mak’ and present that page. But it does NOT do this. Instead, it presents the site_start for the default ‘web’ Context.
Can anyone give me any insight into why this is might be happening and suggest how to fix it?
Thanks in advance for any help offered.