Installation Kirby // Page Not found or Erreur 500

Hello forum,
I have just installed Kirby on my hosting, the installation recommendations are well done on the hosting side:

  • URL writing mode
  • mbstring extension
  • curl extension
  • ctype extension
  • gd extension

However, only the starter kit home page is displayed, the rest of the pages or the panel are in “Not Found
The requested URL /notes was not found on this server.”

When I add a classic htaccess file, I get a 500 error.
Can you tell me how to write the htaccess file correctly?

Thanks in advance

The Staterkit comes with an .htaccess file, please make sure to deploy that to the server. If you don’t see it in the download, make sure to set your OS to show invisible files

Thank you for your feedback,
I have the invisible files added to my FTP.

and my htaccess :

# Kirby .htaccess
# révision 2023-07-22

# Rewriting rules
<IfModule mod_rewrite.c>

# Activer les URLs conviviales (ex: http://dev29.hippocampe.com/about-us/team)
RewriteEngine on

# Définir correctement la RewriteBase pour un sous-dossier
# Comme ton site est dans un sous-dossier (ex: dev29.hippocampe.com), il faut ajuster la base
RewriteBase /dev29.hippocampe.com/

# Bloquer l'accès aux fichiers et dossiers qui commencent par un point (ex: .git), sauf pour .well-known (utilisé pour Let's Encrypt et security.txt)
RewriteRule (^|/)\.(?!well-known\/) index.php [L]

# Bloquer l'accès direct aux fichiers du dossier content
RewriteRule ^content/(.*) index.php [L]

# Bloquer l'accès direct aux fichiers du dossier site
RewriteRule ^site/(.*) index.php [L]

# Bloquer l'accès direct aux fichiers dans le dossier kirby et Panel
RewriteRule ^kirby/(.*) index.php [L]

# Rediriger toutes les autres requêtes vers index.php (pour les liens Kirby)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php [L]

</IfModule>

# Passer l'en-tête Authorization à PHP
SetEnvIf Authorization "(.+)" HTTP_AUTHORIZATION=$1

# Compresser les réponses des fichiers texte
<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>

# Définir des en-têtes de sécurité dans toutes les réponses
<IfModule mod_headers.c>

# Servir les fichiers comme texte brut si le type de contenu n'est pas connu (renforce la sécurité contre les téléchargements malveillants)
Header set Content-Type "text/plain" "expr=-z %{CONTENT_TYPE}"
Header set X-Content-Type-Options "nosniff"

</IfModule>

I also try this minimal htaccess:

# Minimal .htaccess pour tester

# Activer la réécriture d'URL
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /dev29.hippocampe.com/

  # Rediriger toutes les requêtes vers index.php
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php [L]
</IfModule>

If the .htaccess that comes with Kirby is deployed, and you have an Apache server, and you do not see the subpages, then either mod_rewrite module is missing, or you might need to set the rewrite base in your .htaccess to /

1 Like

Perfect it works now !
Thanks a lot !!