Solved it, (in a very horrible way). Turns out someone had already cannibalized my index.php, but the solution for others who don't have this issue is, I think, to hack about with index.php. I found my initial solution didn't work in some contexts so I've edited this post.
In my index.php, the cannibalization started with a session_start() and a load of awful code. I surrounded it with:
if ($_SERVER['REQUEST_URI'] !== "/sitemap.xml") {
session_start();
// BIG MESS OF CODE FUDGING SESSION AND REQUEST VARIABLES - after which I added:
}
Later on there is:
@ini_set('session.use_trans_sid', 0);
@ini_set('session.use_only_cookies',1);
I replaced that with:
if ($_SERVER['REQUEST_URI'] !== "/sitemap.xml")
{
@ini_set('session.use_trans_sid', 0);
@ini_set('session.use_only_cookies',1);
}
else
{
@ini_set('session.use_trans_sid', 1);
@ini_set('session.use_only_cookies',0);
}
Later on there is:
// start session
startCMSSession();
Which became:
if ($_SERVER['REQUEST_URI'] !== "/sitemap.xml")
{
// start session
startCMSSession();
}
I am not sure if session_start() is part of the default index.php or not - as I say my index.php was cannibalized. Equally, some server configurations mean the return value of REQUEST_URI will be different.
If you don't know PHP then do NOT do this - there are a few uncertainties that might be different on your server.
If you do know PHP, take a spare copy of your original index.php beforehand anyway, I resorted to mine many times when the site went down. Save it somewhere safe, close the file so you don't edit it accidentally, lose this at your peril.
ENORMOUS thanks to the people on this post without which I'd be tearing my hair out, I know some of you are still on these forums 5 years on.
[ed. note: technicaltitch last edited this post 10 years, 9 months ago.]