Forum
Converting Perch Page to use Runway Master Page
Hi
I've followed these steps however have missed a critical aspect of the configuration as I keep getting Not Found errors when attempting to view my page in Runway https://docs.grabaperch.com/runway/getting-started/upgrading-perch-to-runway/
In Perch I had a page at /about/aboutus.php In runway I've copied this page to admin/templates/pages/aboutus.php (we use a root folder of admin rather than perch). The file now looks like this
<?php
include($_SERVER['DOCUMENT_ROOT'].'/includes/page_header.php');
perch_content('Page Body & Sidebar');
perch_pages_navigation(array(
'from-path' => '/about',
'levels' => 1,
'hide-extensions' => true,
'hide-default-doc' => false,
'flat' => false,
'template' => 'sidebar.html',
'include-parent' => false,
'skip-template' => false,
'siblings' => false,
'only-expand-selected' => false,
'add-trailing-slash' => false,
'navgroup' => false,
'include-hidden' => false,
));
?>
<?php
include($_SERVER['DOCUMENT_ROOT'].'/includes/page_footer.php');
?>
I've deleted the physical file now and have edited the page in Runway to use this aboutus.php page as the master page
The location path for the page is set to /about/aboutus
The Parent page is set to About
No URL pattern has been entered for the Routes (do I need to enter something here)
I have the following htaccess file at the root of the site (outside our admin folder)
# Perch Runway
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/admin
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* /admin/core/runway/start.php [L]
When I try to access the page at mysite.com/about/aboutus I get the following error
Not Found
The requested URL /about/aboutus was not found on this server.
Can you advise what I've missed in the configuration?
Many thanks
Regards James
Is the 404 a Runway page or your server's default?
Hi Drew is an Apache Server error page
Does that mean I have a problem with the htaccess rewriting rules or need to adjust the route settings?
New pages (without a corresponding perch style php file) created via runway also have the same issue.
Yes, it sounds like your rewrite rule isn't picking the URL up and passing it off to Runway to handle.
Is the rewrite rule that I've copied from the documentation ok? Can you advise what needs to change?
If you've moved your pages and folders out of the site and into master pages, then yes.
I now have this working and am really liking the 'virtual page' / master page templates / page routing of Runway!
Many thanks Drew.