Template Pages Not Found

I am in the process of moving my site to Kirby 3, my home page loads but any subpage gives, Not Found The requested URL was not found on this server.

Everything is contained in a folder called socu.org.2019. Below is my htaccess file.

# Kirby .htaccess

# rewrite rules
<IfModule mod_rewrite.c>

# enable awesome urls. i.e.:
# http://yourdomain.com/about-us/team
RewriteEngine on

# make sure to set the RewriteBase correctly
# if you are running the site in a subfolder.
# Otherwise links or the entire site will break.
#
# If your homepage is http://yourdomain.com/mysite
# Set the RewriteBase to:
#
RewriteBase /socu.org.2019/

# In some enviroments it's necessary to
# set the RewriteBase to:
#
# RewriteBase /

# block files and folders beginning with a dot, such as .git
# except for the .well-known folder, which is used for Let's Encrypt and security.txt
RewriteRule (^|/)\.(?!well-known\/) index.php [L]

# block text files in the content folder from being accessed directly
RewriteRule ^content/(.*)\.(txt|md|mdown)$ index.php [L]

# block all files in the site folder from being accessed directly
# except for requests to plugin assets files
RewriteRule ^site/(.*) index.php [L]

# Enable authentication header
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1

# block direct access to kirby and the panel sources
RewriteRule ^kirby/(.*) index.php [L]

# make site links work
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php [L]

</IfModule>

# compress text file responses
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE application/json
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>

Have you tried RewriteBase /socu.org.2019?

Yep, with Kirby 2 /socu.org.2019/ worked so that’s what I brought over.

Do I need to have anything in my config.php?

To be precise here: Is it set to /socu.org.2019/ or /socu.org.2019 (with and without trailing slash)? And have you tried it with the opposite as well?

Yep, I tried both settings.

And what system are you using? On an apache server? Locally with Mamp or Valet or?

CentOS, apache, PHP 7.1 - neither mamp or valet

It’s 7.1 or above right? Not forcing 7.2?

Yes, from 7.1 upwards.

I don’t know if this has anything to do with the subpages not working, but the media folder is empty the instructions say to remove thumbs, but it doesn’t say to move anything to the new media folder. Does the media folder house all media now? Is it no longer stored in the content?

For example, my home page is trying to show this image - The requested URL /socu.org.2019/media/pages/home/234695749-1547658242/checking-fb.jpg was not found on this server.

But in my media folder, there is not any such directory. Where is it getting that from?

Files still get uploaded to their content folder, but from there, all files are copied to the media folder. You don’t have to do anything though. Just remove the thumbs folder, add the media folder––and you’re done or at least, that is how it should work.

  • is the .htacces file already the new one (edit: looks like it)

  • also, have you tried with both the folder name and / as RewriteBase?

Ok makes sense. I’ll just recap what I’ve done, maybe I’m totally missing something.

  1. Replaced the Kirby folder
  2. Replaced index.php
  3. Replaced .htaccess
  4. Deleted thumbs folder and created media folder
  5. Ran upgrade.php
  6. Deleted accounts and avatars
  7. Removed panel folder
  8. Moved blueprints to /blueprint/pages extcept site.yml

Should that be enough to get me there?

That sounds good and should at least be sufficient for the front-end.

And you don’t have any leftovers from a custom folder setup in a site.php? Nor any config.php settings that might interfere?

I do have a custom config file. I already tried to delete it all though and nothing changes when I do. Oh, also I removed my widgets folder. I’m not understanding what you mean by the custom folder in site.php? Site.yml?

<?php

/*

---------------------------------------
License Setup
---------------------------------------

Please add your license key, which you've received
via email after purchasing Kirby on http://getkirby.com/buy

It is not permitted to run a public website without a
valid license key. Please read the End User License Agreement
for more information: http://getkirby.com/license

    */

    c::set('license', 'K2-PRO-6xxxxxxxxxx');

    /*

    ---------------------------------------
    Cache Setup
    ---------------------------------------
    By default these pages are stored in the cache folder.
    Commment this section out when developing locally or 
    you will have big issues


    TURNED IT OFF - MESSED WITH FORMS
    */

    c::set('debug',true);
    c::set('sitemap.exclude', array('error'));
    c::set('sitemap.important', array('contact'));
    c::set('cache', false);
    c::set('cache.ignore', array(
      'home',
      'search',
      'careers',
      'careers/apply-online',
      'vehicles-homes/socu-owned-vehicles',
      'vehicles-homes/bid'
    ));

    /*

    ---------------------------------------
    Routing Setup
    ---------------------------------------

    Custom routes for long urls

    */

    c::set('routes', array(
      array(
        'pattern' => 'accessibility',
        'action'  => function() {
          return page('/footer/accessibility');
        }
      ),
      array(
        'pattern' => 'rules',
        'action'  => function() {
          return page('/footer/disclosures');
        }
      ),
      array(
        'pattern' => 'forms',
        'action'  => function() {
          return page('/footer/forms-documents');
        }
      ),
      array(
        'pattern' => 'disclosures',
        'action'  => function() {
          return page('/footer/disclosures');
        }
      ),
      array(
        'pattern' => 'faq',
        'action'  => function() {
          return page('/footer/faq');
        }
      ),
      array(
        'pattern' => 'patriot-act',
        'action'  => function() {
          return page('/footer/patriot-act');
        }
      ),
      array(
        'pattern' => 'contact',
        'action'  => function() {
          return page('/footer/contact-us');
        }
      ),
      array(
        'pattern' => 'skip',
        'action'  => function() {
          return page('/loans/skip-a-pay');
        }
      ),
      array(
        'pattern' => 'uigea',
        'action'  => function() {
          return page('/footer/uigea');
        }
      ),
      array(
        'pattern' => 'terms',
        'action'  => function() {
          return page('/footer/terms-of-use');
        }
      ),
      array(
        'pattern' => 'privacy',
        'action'  => function() {
          return page('/footer/privacy');
        }
      ),
      array(
        'pattern' => 'careers',
        'action'  => function() {
          return page('/footer/careers');
        }
      ),
      array(
        'pattern' => 'bid',
        'action'  => function() {
          return page('/vehicles-homes/socu-owned-vehicles');
        }
      ),
      array(
        'pattern' => 'texas',
        'action'  => function() {
          return go('https://secure2.convio.net/ncuf/site/Donation2;jsessionid=00000000.app253b?idb=1020234188&df_id=2083&mfc_pref=T&2083.donation=form1&NONCE_TOKEN=7CE720FB7CAE59C5C33B2038803DCFBE&idb=0');
        }
      ),
      array(
        'pattern' => 'security',
        'action'  => function() {
          return page('/footer/security');
        }
      ),
      array(
        'pattern' => 'repos',
        'action'  => function() {
          return page('/vehicles-homes/socu-owned-vehicles');
        }
      ),
      array(
        'pattern' => 'wires',
        'action'  => function() {
          return page('/wire-instructions');
        }
      ),
      array(
        'pattern' => 'scholarship',
        'action'  => function() {
          return page('/news/19-member-scholarships');
        }
      )
    ));

In Kirby 2 you could set up a custom folder structure by creating a site.php file (next to the index.php in the root of the project), if you wanted to deviate from the standard folder structure.

The config.php syntax has changed, I’m currently not sure to what extent the c::set() setting do still work or not. But if you have removed everything and cleared the cache and it still doesn’t work, hm…

Oh yep, I don’t have any custom site.php file, I’m going to load a fresh install in a separate folder and see what happens.

Thanks. That way we might at least elimate the question, whether it has something to do with Kirby/your Kirby configuraiton. Or whether it is related to the server or so.

Just an update, I grabbed a fresh install placed it on the server updated to PHP 7.2 and still show the issue, so it has to be something going on with my server configuration. Running various updates now to see if I can figure it out.

I ran various updates but to no success. I get to the home page of Kirby 3 but there are no pictures on it only black boxes, if I look at the code it is looking for files in the media folder which there are none on this fresh install. See picture.

It seems like I am missing something that needs to be ran to generate the files into the media folder.