Skip to content

Kirby 3.6.6

Translating URLs

Kirby helps you to create nice URLs for all your pages.

http://yourdomain.com/projects/project-a

Such URLs are readable for your visitors as well as for search engines.

But when working with a multi-language site project, you will be facing the problem that those URLs should somehow be translatable.

http://yourdomain.com/projekte/projekt-a

When multiple languages are configured for your site, you can add an additional slug field to translated content files to translate the foldername of a page.

Non-Panel users

Here's a quick example – English is the default language:

content/projects/projects.en.txt
Title: My Title
----
Text: This is the text for the projects page
content/projects/projects.de.txt
Title: Mein Titel
----
Slug: projekte
----
Text: Das ist der Text für die Projekt Seite

The URL for the English version will be:

http://yourdomain.com/en/projects

and the URL for the German translation will be:

http://yourdomain.com/de/projekte

You don't have to add the slug field to your text files for your default language. Kirby will use the folder name in that case.

Panel users

To translate the URL of a page in the Panel, select the language for which you want to change the URL, click on Settings, select Change URL from the dropdown and then enter the new URL in the dialog. This will store a slug field with the given value in the content translation.