Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2018
    Posts
    121
    Plugin Contributions
    0

    application error How to add the corresponding second-level domain name to different voices

    Examples are as follows

    By default, this domain name is abc.com
    In French, the domain name becomes fr.abc.com
    In German, the domain name becomes de.abc.com

    I want to achieve such an effect how to set up and modify.

  2. #2
    Join Date
    Jul 2012
    Posts
    16,733
    Plugin Contributions
    17

    Default Re: How to add the corresponding second-level domain name to different voices

    Seems to me that it could be a pain to maintain.

    I have two ideas about how this could be accomplished.
    1) basically three "sites" are setup. The first offers the ability to go directly to one of the two other sites. Then each of those sites are located in a separate folder/area having their own database and own product. This seems pretty difficult to maintain.
    2) There is basically one site, the choice of language provides the sub-domain portion of the address and then all links are generated off of the language code of the selected language (e.g. modification of includes/functions/html_output.php for the zen_href_link function to insert the language's code.) and upon reaching whatever languaged address, the code also sets the current language to the language code. So if someone visits de. then they get german, if they access by fr. then they get French.

    Is there some reason to do this instead of possibly using a popup upon access to the site to select a language if no language session data has been set or selected by the visitor? Won't you be competing with yourself as far as rankings where the same product is being offered in two different languages (assuming that the product would be available in both)?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Nov 2007
    Location
    Woodbine, Georgia, United States
    Posts
    4,018
    Plugin Contributions
    61

    Default Re: How to add the corresponding second-level domain name to different voices

    You didn't tell us what version you are running, but for a long time the proper code and tools for multi-linqual sites is already properly marked up.

    Code:
    <?php
    // BOF hreflang for multilingual sites
    if (!isset($lng) || (isset($lng) && !is_object($lng))) {
      $lng = new language;
    }
    if (count($lng->catalog_languages) > 1) {
      foreach($lng->catalog_languages as $key => $value) {
        echo '<link rel="alternate" href="' . ($this_is_home_page ? zen_href_link(FILENAME_DEFAULT, 'language=' . $key, $request_type, false) : $canonicalLink . (strpos($canonicalLink, '?') ? '&amp;' : '?') . 'language=' . $key) . '" hreflang="' . $key . '" />' . "\n";
      }
    }
    // EOF hreflang for multilingual sites
    ?>
    Giving you

    Code:
    <link rel="alternate" href="https://www.domain.com/index.php?main_page=index&amp;language=fr" hreflang="fr" />
    <link rel="alternate" href="https://www.domain.com/index.php?main_page=index&amp;language=de" hreflang="de" />
    <link rel="alternate" href="https://www.domain.com/index.php?main_page=index&amp;language=it" hreflang="it" />
    <link rel="alternate" href="https://www.domain.com/index.php?main_page=index&amp;language=ro" hreflang="ro" />
    <link rel="alternate" href="https://www.domain.com/index.php?main_page=index&amp;language=es" hreflang="es" />
    for example.

    ~Melanie
    PRO-Webs, Inc. :: Recent Zen Cart Projects :: Zen Cart SEO – 12 Steps to Success
    **I answer questions in the forum, private messages are NOT answered. You are welcome to contact us via our website for professional engagements.

 

 

Similar Threads

  1. how to let the second level catagories also show,not only the first level catagories
    By win8win in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 15 Aug 2012, 03:17 AM
  2. How can I add www before my domain name
    By bebe in forum General Questions
    Replies: 5
    Last Post: 4 Dec 2009, 09:23 PM
  3. Second Zen Cart with add on domain?
    By Impact-Flies in forum General Questions
    Replies: 5
    Last Post: 19 Nov 2008, 11:48 PM
  4. How Easy Is It To Change The Domain Name?
    By jaz1974 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 30 Oct 2006, 10:01 PM

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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR