Kirby 3: no access to panel & odd subdomain links

Hi everyone. Sorry if this is a repeat post. I’ve done a lot of research but I cannot find the solution.

The home page to my new portfolio website loads just fine however clicking on any pages attempts to load pages from the sub-domain that my web hosting service automatically creates when I add a domain to a specific directory on the server.

I’m trying to get all webpages for the site including panel access to load from the okiave.com domain. This seems like an .htaccess issue but I could be wrong.

I have a server running php 7.3 that seem to not be properly handling the .htaccess file.
Here’s what I’ve done:

• .htaccess exists with 755 permissions and proper subdirectory rewrite change
• all panel and necessary kirby folders are installed
• php can be verified at okiave.com/info.php

Thank you for any assistance

Could you post the .htaccess please?

Is mod_rewrite enabled on the server? Assuming it is an Apache server.

Is the .htaccess actually used? (If you put some nonsense characters into it, you should get an error)

When looking at your environment variables, SERVER_NAME is exposed as “okiave.okiave.info”. I am not sure, but I doubt that this is correct. Moreover, when going straight to okiave.com, all URLs are prepended with “okiave.okiave.info”. However, when going to okiave.info, everything looks good, panel and links as well. Hence, I assume a misconfiguration of your webserver.

@Adspectus yes things are normal at okiave.info bc as a fall back I made a duplicate of the entire kirby site into the web root of the server. What I’m trying to do is figure out how to use kirby within my preferred subdirectory structure for use on future kirby installations. That prepended url you are seeing is the su domain my server provider automatically creates after I assign a domain to the server. I went through tech support with my server provider and was told that it was scripting issue related to .htaccess

@texnixe Below is the .htaccess for the preferred site location within /okiave instead of web root and yes server error shows if I add gibberish to .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 /okiave


# In some enviroments 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 text files in the content folder from being accessed directly
RewriteRule ^content/(.*)\.(txt|md|mdown)$ index.php [L]

# block all files in the site folder from being accessed directly
# except for requests to plugin assets files
RewriteRule ^site/(.*) index.php [L]

# Enable authentication header
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1

# block direct access to kirby and the panel sources
RewriteRule ^kirby/(.*) index.php [L]

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

</IfModule>

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

# Error pages
ErrorDocument 301 /error
ErrorDocument 302 /error
ErrorDocument 400 /error
ErrorDocument 401 /error
ErrorDocument 402 /error
ErrorDocument 403 /error
ErrorDocument 405 /error
ErrorDocument 500 /error
ErrorDocument 505 /error

Setting the RewriteBase to a subfolder usually only makes sense if you don’t point a domain to it (i.e. if you want to call your site with https://yourdomain/subfolder, otherwise that line should either be commented out or set to /

Wow I feel silly. It was that simple all along. When I read the trouble shooting installation documentation I understood the opposite. Thank you for your help @texnixe