I have uploaded a file to my files folder, so my url is http://www.example.com/sites/example.com/files/myfile.pdf. This site is 'internationalized', with both english and french, using the path prefix (ie: www.example.com/en and www.example.fr).

I now would like to add my file to my sitemap, using "xml sitemap custom". It seems I cannot, as the "add link" page only allow to enter relative path starting with "www.example.com/en" (whatever is selected in the Language combobox). Even if I try to use a relative url using dots (ex: "../sites/example.com/files/myfile.pdf"), the entry is rejected.

Is it a bug or am I missing something? Any advice?

Thanks
kspal

Comments

Anonymous’s picture

Category: bug » support
Status: Active » Postponed (maintainer needs more info)

I'm not convinced it is a bug yet.

Do you have the internationalization module turned on, I assume you must but I don't like to make assumptions on something someone else is doing. How is the file accessed on the internationalized paths via the URL? If it is example.com/sites/mysite/files/myfile.pdf then you want an absolute path and not a relative path.

bessone’s picture

Similar problem to me.

I have i18n modules enabled, if i try to add a custom link to my xmlsitemap, the module add the lang prefix, ie: www.mysite.com/it/my-not-drupal-html-file.html, but the real path of this file is www.mysite.com/my-not-drupal-html-file.html, how i can add it to sitemap.xml? I need to exclude the lang prefix for this files, because they are not drupal path, but real html files.

bessone’s picture

I found the problem, when xmlsitmap generates links for language_none uses the site default language, but for custom links this is a wrong choice. If they are external url and not drupal pages and in the configuration they are "Language indipendent", the generation don't have to add the default language prefix.

I made a quick and so-so-dirty solution, don't check for custom link, just don't use the default language for all "und" links.

xmlsitemap.generate.inc (line 167)

     if($link['language'] == LANGUAGE_NONE){
      $link['language'] = $link['language'] != LANGUAGE_NONE ? xmlsitemap_language_load($link['language']) : $url_options['language'];
      $link['language']->language = 'und';
     }
     else{
      $link['language'] = $link['language'] != LANGUAGE_NONE ? xmlsitemap_language_load($link['language']) : $url_options['language'];
     }
mgifford’s picture

Issue tags: +i18n

tagging

kristen pol’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (outdated)

Closing since this is so old.