Hi folks,
I am new to Kirby but have done WordPress development before.
A client has asked me to make some minor changes to their Kirby site and I thought I would take a crack at it.
I have played around with the starterkit-master by serving it up with MAMP. However, when I try and do the same process with the files that the client sent me I get:
“This site can’t provide a secure connection
localhost sent an invalid response.
ERR_SSL_PROTOCOL_ERROR”
I have tried putting a “/panel” at the end of the URL thinking maybe I needed to create my own account for this installation, but that yields the same outcome.
The structure of the files that my client sent me looks very similar to the starterkit-master:
Can anyone give me a hint as to where I might be going wrong here, please?
Thanks in advance!!
Could you post the htaccess and the config? Sounds as if the site tries to enforce an SSL connection.
Here is the htaccess are you looking for the config.php? if so…that file is empty.
# Kirby .htaccess
# revision 2020-06-15
# 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 /mysite
# In some environments 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 all files in the content folder from being accessed directly
RewriteRule ^content/(.*) index.php [L]
# block all files in the site folder from being accessed directly
RewriteRule ^site/(.*) index.php [L]
# 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>
# pass the Authorization header to PHP
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
# 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>
That looks like a standard htaccess. Is the error coming from the browser rather than Kirby? Are you trying to access the site via https instead of http?
I am trying to access it in the same way that I was able to access the Sample site that I got from the StarterKit. I drop the folder in my MAMP htdocs and then go to my localhost and open the folder. The StarterKit site works just fine. I just can’t figure out what the road block with my client’s files is.
Hm, hard to tell without actually seeing the code.
Which Kirby version does this project use?
If you want me to have a look at the files, feel free to send me a link to the downloadable project via PM.
It’s using Kirby 3.2.5 according to the composer.json.
Unfortunately I can’t give you access to the site files, as I am under NDA. I was hoping you r someone, could point me to some areas that might be causing the issue so that I could troubleshoot it myself.
Thanks for your help so far. If you have anymore ideas short of reading the code, that would be greatly appreciated!
What is you PHP version on MAMP? You browser and version? Have you tested with other browsers?
PHP version 7.3.1
Browser: Chrome Version 84.0.4147.89
Just tried with Safari and got the same error
Additionally, I tried copying over the /assets, /media, /site, and /content folders over to the StarterKit-master and I was able to get the raw site to launch. but none of the css is being applied.
A caching problem, maybe? Have you cleared the browser cache?
Are the styles loaded? Have you checked your browser console?
Yeah I’ve got a shit ton of errors there…I imagined they are coming from broken paths because I just copied the folders over.
These errors look really weird, where does the echo part in the URLs come from? Looks like there’s something wrong in the php code.
I found it in the code. There are several instances of “<?echo $kirby->url('assets')?>” to get the dynamic path to these assets
Ah, ok, then if you change <?echo to proper php opening tags
<?php echo $kirby->url('assets')?>or the short echo tag
<?= $kirby->url('assets')?>`, that should fix it.
Using the short opening tag <?
is considered bad coding style (also in WP) and requires that you allow these short tags in your .htaccess
.
Thank You, Kind Soul!!! The site is presenting much better now!!!
I fear I will run into the SSL error somewhere down the line, but I think I am at a point that I can make the changes that I am tasked to do; at least in the code
…deploying it may be an issue… I will cross that bridge when I get to it!
Thanks again!!!