404 on Sub-pages- please help!

I just uploaded my kirby site to a new BlueHost server and can see the index.php page but all links come up as 404s.

Please help! Very frustrated.

Have you uploaded your .htaccess file as well? Is mod_rewrite enabled on the server? If yes, try setting the rewrite base in .htaccess, either to “/” if its in the root folder or to /your-subfolder if Kirby is located in a subfolder.

I uploaded my .htaccess default file and not even the home page showed up- then i uploaded what Bluehost had as their .htaccess file and just the homepage showed up, but then 404s for all the links…

I tried to change the .htaccess rewrite base to “/” and nothing changed.

Here is current my .htaccess:

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

# 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

and the site: http://50.87.248.126/~simmont1/

Then when I use BlueHosts’ htaccess file, just the homepage shows up, but 404 on links. here is all the code:

# Use PHP5.4 as default
AddHandler application/x-httpd-php54 .php

Well, you need to use the .htaccess file that comes with Kirby otherwise the rewrite doesn’t work. What kind of error do you get with the Kirby .htaccess? Is there anything in the server error logs?

[Edit] Try adding the above lines from the Bluehost .htaccess at the top of your Kirby .htaccess

I believe this should be

RewriteBase /~simmont1/

You have to use Kirby’s .htaccess file and possible merge it with any configuration from your hoster’s .htaccess.

Hey thanks!

So I’m using the kirby .htaccess file with the added lines:

# Use PHP5.4 as default
AddHandler application/x-httpd-php54 .php

I can now see the front page, but then when clicking a link something new happens where it tries to go to:

http://50.87.248.126/~simmont1/~simmont1/~simmont1/~simmont1/~simmont1/~simmont1/~simmont1/~simmont1/~simmont1/~simmont1/~simmont1/~simmont1/~simmont1/~simmont1/~simmont1/~simmont1/~simmont1/~simmont1/~simmont1/~simmont1/~simmont1/~simmont1/projects/project-a

That can’t be right, ha.

Looked at the server error log and get this: ugh

PHP Fatal error: require() [function.require]: Failed opening required ‘DIR/kirby/bootstrap.php’ (include_path=’.:/usr/lib64/php:/usr/share/pear’) in /home2/simmont1/public_html/index.php on line 6

Have you set the rewrite base? If so, maybe you should disable that again …

[Edit] I guess the error log message refers to the time before you enabled php 5.4 in the .htaccess, so that should not be the case anymore.

All the links are working now, except for the project pages- or sub-sub pages…

Even the 404 changed into a formated page.

I can’t find any error anymore, have you cleared your browser cache? Could you post what did the trick?

It all works great! Thank you!