We've launched a new support center at help.smartling.com. This site will continue to be maintained into January 2017. Please update your bookmarks.
Follow

Handling Link Rewrites

The following article applies to Global Delivery Network project types. 

To keep users on a translated site such as fr.example.com, Smartling automatically rewrites links included in source content.

You have several options for handling link rewrites:

  1. Keep the source link intact but have Smartling allow for translation of the text strings using the SL_norewrite tag.
    In this case you may want users to switch to the source language or complete a similar task on the source language domain.
  2. Have both the source link and text remain identical to the source content using the SL_opaque tag
  3. Manage link rewrites or redirects for HTML with specific class or ID tags
  4. Prevent link rewrites for 30 x redirects by adding an HTTP header to the redirect call

1. To prevent rewrites of source links but translate text strings:

  • Include the HTML that contains the text strings within the SL_norewrite class.
    For example:

    <a class="SL_norewrite" href="//www.example.com">The link address will remain unchanged, but this text will be translated.</a>

    Smartling will not rewrite "www.example.com" to the current translated site, such as "fr.example.com," but will allow for translation of the text inside. This works from the actual tag that specifies the class, so in the example above, Smartling does not rewrite href.

    The links must be fully domain qualified (for example, //www.example.com or http://www.example.com) as Smartling will rewrite relative links.

2. To prevent rewrites of both source links and text strings:

  • Include the HTML that contains the text strings within the SL_opaque class.
    For example:

    <a class="SL_opaque" href="//www.example.com">The link address and this text will remain unchanged.</a>

    Smartling will not rewrite "www.example.com" to the current translated site, such as "fr.example.com," nor will it allow for translation of the text inside.
    The links must be fully domain qualified (for example, //www.example.com or http://www.example.com) as Smartling will rewrite relative links.

3. To manage link rewrites using the class or ID name of the tag:

  • At Global Delivery Network > Configuration > Rules > Translation Rules add specific rules related to HTML elements with specific class or IDs.

4. To prevent link rewrites to a localized URL for 30 x redirects:

  • Add a "SL_NOREWRITE_REDIRECT" HTTP header to the redirect call.
    In PHP, this looks like:
    <?
    Header( "HTTP/1.1 301 Moved Permanently" );
    Header( "SL_NOREWRITE_REDIRECTS: 1" );
    Header( "Location: http://localhost:8080/test/sm.htm" );
    ?>
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request
Powered by Zendesk