Adding a Kirby blog to an existing php/html website

Hi
I have an existing website (php/html/css/bootstrap) which I would like to add a Kirby blog to.

My existing site has an index.php file (my home page) and various other pages in a subfolder.

It looks like the Kirby blog has to existing in the content folder. Do I need to move my existing pages to the content folder or can I leave them where they are and just put the blog into content.

Also, if I do this, I have 2 x index.php at root level…

Are there any instructions for adding Kirby to an existing site?

Thanks

How about putting Kirby into a separate folder (you would have to do that anyway), and giving this Kirby installation its own subdomain, e.g. blog.yourdomain.com?

Thanks - yes I can see that should work technically - I will give it a go.

Unfortunately I really want it installed at the top level as I have existing blog I want to migrate and ideally I would preserve their urls (domain.com/blog/myblogetc)

Maybe it works if you put the Kirby stuff into a folder called blog and then set the url in the config to this subfolder.

Not tested. You probably have to fiddle with htaccess or your vhost config.

Have never tested this, though.

Check out this thread as well: https://forum.getkirby.com/t/only-using-kirby-as-a-blog-plugin-to-my-existing-site/14969/3 (can’t remember what I suggested there :wink:)

If you go down the subdomain route, you could redirect your old links to this new domain and nothing would be lost.

I’ve got it to work by leaving the kirby files at the root level and replacing my templates/home.php with my original index.php code (moving some of it into header and footer snippets). Then from my index.php navigation I link into the other pages of my site (which are unaffected) and also into the templates/blog so I can use the Kirby blog functionality. (www.cow-shed.co.uk).

Now I’ve just got to get my blog page to show the blog images (I can get the articles to show the images, just not the main blog page yet). Off to watch Bastian’s YouTube videos again!

Thanks - in the end I just added all my pages to Kirby but I can see the redirecting could have worked too.

1 Like

The videos were great - the images are working now!