Forum
Sub-directories and file name conflicts with URL redirects
HI,
I'm trying to create a nested page structure where the sub-directories have the same name as the parent page. This would look like this for instance:
file = /open-programmes.php
sub-folder = /open-programmes/programme-name.php
I have the URL redirects on the top level pages working fine, but as soon as I want to create another level of pages with the same name structure I run into problems.
I've also tried putting an index.php file in the sub-directory instead, but this doesn't seem to work either. When I change the sub-directory folder name to something different from the file name it works, but this defeats the purpose of the file names and paths all being the same.
Please help, I'm a novice so please speak plainly :-)
Greg
Create your file as:
To do that in Perch, create a new page with the title "Open Programmes" and check the box that says the page will have more pages below it.
Thanks Drew,
I've done that, saved the pages as index.php and put them in sub-folders with the same name and altered the paths in the page details settings so that:
is now
This is now giving me a white screen. I'm changing the files manually and not through the interface. Anything else I'm missing? Would you need a diagnostic report?
What is in your error log?
https://solutions.grabaperch.com/development/why-am-i-getting-a-blank-page
PHP Error log
Your runtime include is incorrect, you need to update it to include the file at the correct path if you are in a subdirectory. So ../admin/runtime.php not admin/runtime.php.
Bingo! Thanks for the out of hours help :-)
In case it's helpful to others, I've learnt that every level deeper in the tree requires another ../ so:
and so on...