Blank subpages (homepage is fine though)

Hey there,

I just changed my Kirby site to a new server, all seemed fine (surprisingly!), homepage loaded complete. Then try and click on a link and nope, directs to a blank a page. Try and access the /panel/, same thing.

This is it:

Kirby v2
PHP 7.2
Checked the permissions and they all seem fine.

I’m trying to dig out if there’s anything to do with configuration from the previous website, but not finding anything yet! Thanks for any ideas.

you could try RewriteBase / in .htaccess

Tried that, and RewriteEngine on.
Neither worked, thanks though.

Seems to be a problem with the RewriteBase though, on 1und1 you usually really have to set it to

RewriteBase /

as suggested by @bnomei.

Does the .htaccess file do its job at all? Try and add some rubbish, you should then get a 500 error.

I’ve added some random text on the .htaccess, removed everything to do with RewriteBase, and I got no errors – apart from the homepage image being missing now. Same blank pages on links.

Is 1&1 completely ignoring the .htaccess?

Looks like it is completely ignored, yes. Random characters in a working .htaccess will always result in an error.

Ok, for future reference, it was a matter of adding some more bits to the .htaccess.
This is what I’ve got:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteRule (^|/)\.(?!well-known\/) index.php [L]
RewriteRule ^site/(.*) index.php [L]
RewriteRule ^kirby/(.*) index.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php [L]

Hm, that doesn’t look like the Kirby 2 .htaccess but the kirby 3 .htaccess, event though something is still missing there

This is the complete Kirby 3 .htaccess file:

# Kirby .htaccess

# rewrite rules
<IfModule mod_rewrite.c>

# enable awesome urls. i.e.:
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
# Set the RewriteBase to:
# RewriteBase /mysite

# 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]


# 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

Currently, your text files in the content folder are still directly accessible, you don’t want that.

Yes I got some of the htacces from Kirby 3 as I noticed it was more complete.
Thanks for flagging the access to text files!

Though now that that’s fixed, the Kirby panel page (/panel) shows as a 404…
So can’t be a htaccess. Any ideas?

Thanks again.

You can’t use the Kirby3 htaccess for Kirby 2. Please use the original Kirby 2 .htaccess provided with the Starterkit.

Yeah that worked.