Results 1 to 7 of 7

Thread: [solved] Main language without language code

  1. #1
    User
    Join Date
    01-29-13.
    Posts
    64

    Default [solved] Main language without language code

    Hello,
    I've been developing a website using Contao 3.0.6 and changelanguage extension. The website is correctly interpreted and everything works fine and I'm now looking for SEO.

    I already checked italian as main language, so 'it' root is the main website root while 'en' is the other branch. I'd like italian pages not to be
    Code:
    http://www.netstorming.net/it/something
    but just
    Code:
    http://www.netstorming.net/something
    , since it's the main language. It's good for me to keep having
    Code:
    http://www.netstorming.net/en/something
    for english pages, therefore I can't just un-check the "Add the language to the URL" checkbox in the settings page. I want just the main language to be without ISO-code, but fot the others it's good to have it.

    Do you think I can achieve this somehow?

    Thank you in advance
    --
    Marco
    ---------
    Triste e' l'uomo
    che ama le cose
    solo quando si allontanano.
    (Baolian, libro dei pensieri Baol, I, vv. 1240-1242)

  2. #2
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Main language without language code

    You could do it with folder structured aliases. I'm not sure if Contao 3 supports this out of the box, but for Contao 2 there where extensions to add support for folder urls. What you need to do is disable adding language to the url, and for all other languages add the language to the page alias. It is a bit more work to maintain though, you need to be more precise...

  3. #3
    User
    Join Date
    01-29-13.
    Posts
    64

    Default Re: Main language without language code

    As far as I know (by searching around) none of the extensions devoted to url-folder aliasing is working on Contao3. I liked the idea of removing the language from the url and place it at the beginning of the alias, telling Contao to split the alias by itself. It's a pity it does not work, or at least I couldn't make it work.

    In the settings page I unchecked "Add the language to the URL" and checked "Enable folder URLs". Then I went to the home page in site structure and put "en-home" in the alias. The page url now is http://domain/en-home.html and not http://domain/en/home.html as I expected. So I don't know what to do now...
    --
    Marco
    ---------
    Triste e' l'uomo
    che ama le cose
    solo quando si allontanano.
    (Baolian, libro dei pensieri Baol, I, vv. 1240-1242)

  4. #4
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Main language without language code

    If you put en-home in the alias then your alias will be "en-home". What you should have tried was using the alias you wanted in the first place "en/home". And When you enable "Enable folder URLs" then a slash is allowed, as it seems Contao 3 does support this out of the box.

    So that solves everything for you, right?

  5. #5
    User
    Join Date
    01-29-13.
    Posts
    64

    Default Re: Main language without language code

    Yes Ruud,
    this seems to solve everything. It's not that fast but it works!

    Thank you very much
    --
    Marco
    ---------
    Triste e' l'uomo
    che ama le cose
    solo quando si allontanano.
    (Baolian, libro dei pensieri Baol, I, vv. 1240-1242)

  6. #6
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: [solved] Main language without language code

    You could post a feature request on github contao/core, something like "hide language in url for main language" I would give it a 1+, but I don't know if other people will... First search if no-one already requested this. If you do post this feature request, please post the link to the issue here.

  7. #7
    User
    Join Date
    01-29-13.
    Posts
    64

    Default Re: [solved] Main language without language code

    --
    Marco
    ---------
    Triste e' l'uomo
    che ama le cose
    solo quando si allontanano.
    (Baolian, libro dei pensieri Baol, I, vv. 1240-1242)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •