Forum
Pages created through Perch have incorrect URL
Hello,
New pages created through Perch are being shown in the UI with an incorrect URL. The pages exist in the right place, but the page dies when viewed.
URLs look like this: /what-we-do/job-evaluation-trainingC:/xampp/htdocs/beamans/what-we-do/job-evaluation-training/jegs-practitioner-training.php
In this instance, the correct URL should be: /what-we-do/job-evaluation-training/jegs-practitioner-training.php
Seems to be a problem with pages more than two levels deep, e.g. Site root (OK) > Level 1 (OK) > Level 2 (OK) > Level three (page problem).
When viewed, the page shows: Warning: include(......\perch\templates\pages\service_offering.php): failed to open stream: No such file or directory in C:\xampp\htdocs\beamans\what-we-do\job-evaluation-training\jegs-evaluation.php on line 1
Warning: include(): Failed opening '......\perch\templates\pages\service_offering.php' for inclusion (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\beamans\what-we-do\job-evaluation-training\jegs-evaluation.php on line 1
Editing the URL within Perch does not fix the error when displaying the page.
Problem found in Perch 2.5.4, and exists in 2.6.0 too.
Thanks, Jon
Can you show me your diagnostics report?
Health check
Summary information
Perch information
Hosting settings
When did this start?
During site development today. I don't use the Pages functionality much, and this is the first time I've noticed this problem.
But it was working fine previously?
I've not used Perch this way before, that would have to be a "don't know", I'm afraid.
Ok. Presumably this isn't the production server?
That's correct. It's a new site in the early stages of development.
I think it must be something to do with the environment. I'm unsure as to why you have paths like this:
I'd expect that to be more like this on Windows:
I see. I checked my Apache (XAMPP) config, and the document root for this site is set up using the Windows backslashes (as below). Apache is seems to be converting the path to a UNIX-style one.
I don't know if this is a standard thing for Apache on Windows, or whether it's simply a feature of this version of XAMPP or PHP. I have had problems previously with slashes in Perch on Windows (multiple versions of Windows/XAMPP/PHP - see my previous support tickets), but these have been resolved when moved to production because the production server is inevitably a flavour of UNIX.
Yes, I see. I don't know if that's the source of your issue, but it's a possibility. As you'll have gathered, cross-server compatibility is just as complex an area as cross-browser compatibility. Perhaps even more so, these days.
Thanks Drew.
So, reading between the lines, do I understand correctly that this isn't something you can support? If so, no worries - I have another solution up my sleeve.
No, it's not that, it's just I'm not sure where to go next.
OK, that's great news. If I can help in any way, let me know.
For me, it seems odd that the corrupted URLs are only being created for "grandchild" pages. "Child" pages do not have corrupted URLs even though they're created through the same process (I assume).