How to properly install kirby?

I am opting for a installation in a subdirectory.

There is a .htaccess inside kirby installation and in order to install it in a subdirectory I should uncomment the line RewriteBase /folder. After doing that where should I put this .htaccess, on the root or in the sub?

I made a test and set the rule to RewriteBase /v1 which is correct. After doing that if I access the domain.com, it was not redirecting to domain.com/v1 regardless if the .htaccess is in the subdirectory or in the root.

So, what should I do? What is the correct way to install kirby in a subdirectory?

Am I missing something? Should I do a 301 redirect from the root to /v1? Should I write a custom .htaccess in the root to redirect to /v1? Even if I do so, it is necessary to keep kirby’s .htaccess inside it’s folder??

Help me out, I’m lost!

If everything works fine, when you are accessing yourdomain.com/v1, then the Kirby installation is correct :smile:

But I don’t understand why you want to use a subfolder, when you redirect everything from root to /v1? Why don’t you use Kirby without a subfolder?

I think for your purpose you should in fact have two .htaccess files, one in your root directory with the redirects to the subfolder, and the original Kirby .htaccess within the Kirby folder. If or not it is necessary to uncomment the RewriteBase depends on your server settings. I have found that sometimes you need to set the RewriteBase, sometimes you don’t and the base varies as well.

An alternative would be to point the www- and non-www domains to the Kirby subfolder in your domain dashboard settings.

@jmsecchis:

I agree to @texnixe and think to change the DNS entry should be the first attempt.
But this depends on your hoster!

Following this, you avoid one redirect!

Wow, this sounds perfect: changing the DNS zone file!

Thank you very much for the insight!