Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi domain #343

Open
j2vos opened this issue Jun 3, 2024 · 1 comment
Open

Multi domain #343

j2vos opened this issue Jun 3, 2024 · 1 comment
Labels

Comments

@j2vos
Copy link

j2vos commented Jun 3, 2024

Hello,

I have a site with 2 domains:

www.domain.fr
www.domain.be

The .be domain manages 2 languages:
www.domain.be/be-fr
www.domain.be/nl-be

This is the same content on both sites (Change of translation)

How to configure the presta_sitemap.yaml so that it correctly generates the 2 sitemaps?

THANKS
Jeremy

@j2vos j2vos added the question label Jun 3, 2024
@yann-eugone
Copy link
Member

yann-eugone commented Jun 4, 2024

Hi Jeremy,

I've never done such things myself, the double requirement of domain + prefix can be a bit tricky here

I believe you will have to start with configuration of alternates in the bundle:
https://github.com/prestaconcept/PrestaSitemapBundle/blob/4.x/doc/2-configuration.md#translated-routes

presta_sitemap:
    alternate:
        enabled: true
        default_locale: 'fr_FR'
        locales: ['fr_FR', 'be_FR', 'nl_BE']
        i18n: symfony

But then, it will be Symfony's responsibility to determine what domain should be used for what language
https://symfony.com/doc/current/routing.html#localized-routes-i18n

controllers:
    resource: '../../src/Controller/'
    type: attribute
    prefix:
        fr_FR: '' # don't prefix URLs for the default locale
        be_FR: '/be-fr'
        nl_BE: '/nl-be'
    host:
        fr_FR: 'www.domain.fr'
        be_FR: 'www.example.be'
        nl_BE: 'www.example.be'

Given that you are using Symfony for your translated routes
Otherwise you will have to add routes all by yourself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants