404 on /panel page for setup

I’m trying out Kirby for the first time.

I downloaded the starter kit, created a local git repo, and deployed to a test server. In my browser I can see the demo website fine. All is well until I go to install the panel. On mywebsite.com/panel all I get is a 404 Not Found. I can verify that the directory exists and has the right files in it.

What am I doing wrong?

I’ve run into lots of 500 errors when installing the Panel, but never a 404, so without more info, two ideas I can think of -

  1. The panel folder is in the wrong place (it needs to be in the same directory as index.php)
  2. .htaccess is rerouting

Could you copy/paste your .htaccess file? Or if it’s nginx, the relevant portions of your site’s conf file?

1 Like

My panel folder is in the same directory level as the site’s index.php file.

Here’s 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 /mysite

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

# block all files in the site folder from being accessed directly
RewriteRule ^site/(.*) error [R=301,L]

# block all files in the kirby folder from being accessed directly
RewriteRule ^kirby/(.*) error [R=301,L]

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

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

</IfModule>

# Additional recommended values
# Remove comments for those you want to use.
#
# AddDefaultCharset UTF-8
#
# php_flag short_open_tag on

Okay, so you’ve got the default .htaccess, no problems there.
Sometimes I have issues when I’m missing a RewriteBase though, try changing

# RewriteBase /mysite

to

RewriteBase /

I tried that and no change.

I noticed that none of the other links on the demo site seem to be working either. 404 on everything but the home page. Very strange.

That definitely sounds like an .htaccess problem. Like your .htaccess is being ignored. Although you still should be able to get to the panel if that was the case. Just to rule it out though, do you have access to this server’s configuration, and if so, are any other sites properly paying attention to .htaccess? If Apache was never configured, you may need to add or modify a line in its default site configuration. (Particularly, you’ll need an AllowOverride All in the Directory section of the Apache site config file.)

It’s also possible that mod_rewrite isn’t installed either. Derps. I hate Apache debugging, hopefully that’s not the problem.

Darn. Maybe it’s just an issue with the hosting. I’ll have to try again in a different environment.

I’ve found it’s pretty rare that a webhost, even cheap shared hosting, has mod_rewrite turned off. But there are exceptions. Have fun!

I just had this problem on my site. I had mod_rewrite enabled, but the Apache site config had AllowOverride to None, preventing the .htaccess file from overriding anything. I changed that to FileInfo and it started working.

1 Like

I’m having this same issue. Running kirby locally from my sites folder on a mac. /panel takes me to a 404 Not Found page. The .htaccesss file is there and I’ve tried uncommenting RewriteBase. Nothing is working. Please help!

Thanks!

Have you checked all of the above suggestions? What about links to subpages, do they work?

Do you use Mamp?

I have tried all the suggestions above except for the mod_rewrite stuff - not even sure how to change that. None of the subpages work either. I’m not using MAMP, I’m doing everything from my Macintosh HD/Users/Username/Sites folder. All previous sites I’ve built work fine locally this way, but they were all hard coded and not using a cms.

Thank you for responding! Any help you can offer is greatly appreciated!

If you are using the inbuilt apache server, check your httpd.conf file in /etc/apache2, and uncomment the following line to enable mod_rewrite:

#LoadModule rewrite_module libexec/apache2/mod_rewrite.so

I can’t find any file on my computer named httpd.conf. I don’t see a /etc/apache2 file path either. The closest thing I can find is usr/include/apache2. Am I missing something?

Just found out there is a reply limit for new members… So I’ll just have to edit this post. I was able to get it to work on my live hosted site: http://catsandcocktailsbar.com/kirby/ Still not sure why I can’t get it working locally. For the live version, I just left the .htaccess file at it’s original state and it somehow works fine. I’d still prefer to keep working locally while I build my site, but I’ll give this a try for now.

Any further help you’re willing to give is always appreciated. Thank you for your help and patience, Sonja!

Update 01:
@texnixe I can’t /etc/apache2 anywhere. I went digging through folders and did searches for file names, the text “LoadModule”, etc. Couldn’t find anything fitting your description.

Update 02:
@texnixe I found the httpd.conf file. Still learning how to navigate the hidden folders on a mac and how to work with Terminal. I uncommented LoadModule rewrite_module lib exec/apache2/mod_rewrite.so and I’m still having the same issue. I could try using mamp - I quit using it for some reason. I forget why now, but i remember being frustrated with it for some reason.

Update 03:
@texnixe I installed MAMP and the everything seems to work fine locally! Still wish I could figure out why it wouldn’t work from my sites folder. But, I am able to work locally now! Thank you!

Does the folder /etc/apache2 exist at all? Or is it just the file missing?

This is weird, since you are using the apache server that ships with OS X, aren’t you? What version of OS X are u using?

Well, how about installing MAMP for local development?

Or wait until someone comes up with another idea …

1 Like

Maybe the .htaccess is ignored:

Try changing this line (line 258) in your httpd.conf

AllowOverride none
to
AllowOverride all
1 Like

I figured it out. And the answer is kinda silly on my part.

The RewriteBase line in my .htaccess file was this:
RewriteBase /subfolder

Because I was using my sites folder it needed to look like this:
RewriteBase /~username/subfolder

Thank you for all your help!

I was having the same problem with my Wamp install. I had to uncomment “LoadModule rewrite_module modules/mod_rewrite.so” in my httpd.conf file located in: wamp > bin > apache > apache2.4.9 > conf

I also had to restart Wamp for the change to work.

I’ll add another solution to the pile. /panel was redirecting to Kirby’s error page, and the problem was with file permissions.

I made sure all the files and folders had proper permissions and the problem went away. I find that this solution also fixes 500 errors in some shared hosting environments.

# Loop through all files recursively and change permissions to 644
find starterkit/ -type f -exec chmod 644 {} \;

# Loop through all folders recursively and change permissions to 755
find starterkit/ -type d -exec chmod 755 {} \;