Home page in folder won't load without index.php?id=36

This question was asked in October 2023, but I can’t see the answer in what was posted there.

Problem: I am building a new MODX website in a subfolder temporarily, and for a while it was working perfectly by using a URL like https://domainname.com/new24/ Suddenly the home page stopped loading and instead all attempts to load the home page were redirected to the “root” (?) https://domainname.com The manager works fine, and if I load a resource for a page that is not the home page and click View, it loads that page in a new tab fine, and from there I can see all the other pages normally except the home page, which always redirects to the home page outside the new folder (the old home page).

The htaccess file is:

RewriteEngine On
RewriteBase /new24

DirectoryIndex index.php index.html

RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} ^www.(.)$ [NC]
RewriteRule ^(.
)$ https://%1/$1 [R=301,L]

RewriteCond %{HTTPS} !=on [OR]
RewriteCond %{SERVER_PORT} !^443
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

#block core access
RewriteCond %{HTTP_HOST} ^(www.)?thalassagarden.com/$ [NC]
RewriteRule ^(.(?!well_known)|_build|_gitify|_backup|core|config.core.php) /index.php?q=doesnotexist [L,R=404]

The Friendly URLs part

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

The site settings set the site start to resource with id 36.

The alias for id 1 resource is “home” and for 36 it is “test-home-page”. Both load normally if not set to be the site start, and both get redirected if set to be site start.

In the new24 folder there is no other index file, only the standard modx index.php file from the 3.0.5 package. The root outside the new24 folder has an index.html, but when I delete that the redirection continues so appears to be irrelevant.

What am I overlooking?

Just want to add the following observation: There must be some Divine Force in the MODX community. I see no other explanation. I was tearing my hair out for over 24 hours with this damned redirect, getting nowhere. Then finally post the question to the MODX community. And without even getting a reply, the problem is solved. Somehow - by some miracle - the new home page no longer redirects to the old.

My only problem now is (and this is certainly not the first time), I have no idea why the redirect was happening, and I have no idea what occurred (mysteriously in the background) to solve it. Was it just some cache issue that needed a certain amount of time to clear?

I doubt whether the Drupal and Joomla fora can boast that just posting the problem is enough for it to be solved.

1 Like