Panel and all other pages except home not visible

I know this question has been asked a lot of times but none of the previous topic seem to solve my problem. I’m trying to get a website live on a clients hosting (this hoster doesn’t let me see or change anything within a cpanel/directadmin/plesk environment).

I’ve uploaded the website including the .htaccess from my localhost (in which it’s working perfectly) to the server and only the homepage is working. The panel and all the other pages are not accessible (404 not found). I’ve uploaded the same files to my own hosting environment and everything is working fine.

  • I know the .htaccess is being read because I tested it with a redirect.
  • I’ve tried setting “RewriteBase /”

The hosting company has terrible support and is either not responding, or really slow. Does anybody has a clue what to do? I’ll share my .htaccess below.

# Kirby .htaccess
# revision 2020-06-15
# rewrite rules
<IfModule mod_rewrite.c>

# enable awesome urls. i.e.:
# http://yourdomain.com/about-us/team
# 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>

Maybe mod_rewrite isn’t installed (don’t know what kind of redirect you tried).

What happens when you remove the <IfModule mod_rewrite.c> and </IfModule> parts?
If it’s really apache, and mod_rewrite isn’t installed it should blow up with an error 500 page.

I’ve tried the redirect below to see if it was working and it was redirecting. Which (correct me if I’m wrong) seems to indicate that mod_rewrite is installed?

RewriteEngine On
rewritecond %{http_host} ^mydomain.com
rewriteRule ^(.*) http://www.somerandom.com/$1 [R=301,L]

However when I try your solution I get an error 500…

Still no reaction from the hosting company and they want the website live today… Is there someone here who can point me in the right direction please?

Have your tried to add the RewriteEngine On line (which was present in your redirection test that worked) to your Kirby .htaccess file before the RewriteBase rule?

I’ve tried this but unfortunately also not working…

# Kirby .htaccess
# revision 2020-06-15
# rewrite rules
<IfModule mod_rewrite.c>
# enable awesome urls. i.e.:
# http://yourdomain.com/about-us/team
# 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:
#
RewriteEngine On
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>

Where are you hosting? Are the installed Apache modules shown with phpinfo()?