WordPress.org

Ready to get started?Download WordPress

Forums

Google XML Sitemaps
Swedish characters in url (17 posts)

  1. stefangalen
    Member
    Posted 1 year ago #

    I have a Swedish character in the url http://www.bästalotterna.com. It's an "a" with two dots above. It seams that sitemap-generator can't handle that. It's says that it having problem writing the file. In the detected path for the file there is an black question mark instead of the ä (the a with the dots).
    I tried some other xml-generators and they work fine but sitemap-generator looks like the best one. Can anyone help me to get this to work.

    http://wordpress.org/extend/plugins/google-sitemap-generator/

  2. Kimberly
    Member
    Posted 1 year ago #

    It's called a "umlaut" represented in html as ä or ä.

    Anyway it sounds like your PHP is not set to the correct character set to handle this special character. So I believe you need to convert the character to ISO-8859-1.

    If you are comfortable with coding jump into this plugin's main php file and use preg_replace("/ä/",chr(138),$string). The output should be a true umlaut.

  3. stefangalen
    Member
    Posted 1 year ago #

    Thanks Kellogg9,
    but I can't find any main php file for the plugin. It could be "xml-sitemap-xml-sitemapcouk/xmls.php" but then I don't know where in the file I should put your code.

    In the file I found this in two locations: $sitemap = '<?xml version="1.0" encoding="UTF-8"?>

  4. Kimberly
    Member
    Posted 1 year ago #

    Sure, i can help you....i will look into the fix myself directly in the source code when i have time later today.

    Just realized since your domain is an IDN (Internationalized Domain Name) it will need to be PunyCode'ed. Punycode is a encoding syntax by which a Unicode (UTF-8) string of characters can be translated into the basic ASCII-characters permitted in network host names (you do this via: idn_to_ascii("www.bästalotterna.com"); ). For example, although you see the umlaut, underneath (and in your website's source code i see your domain is: http://www.xn--bstalotterna-gcb.com. A few more questions:

    1. Can you provide the exact error message?

    2. You mention: "In the detected path for the file there is a black question mark". Was this error in your error_log file or where exactly are you seeing this?

    2. Is the problem occurring when PHP attempts to write out the sitemap.xml file whereby inside said file an XML node(s) line is attempting to prepend your host url: http://www.bästalotterna.com to your article page locations?

    3. Is the path directory of your site inside a directory called bästalotterna.com? So the directory literally shows an umlaut?

    We may need to try a few things since i have never quite worked with IDNs before but am very curious to get this to work.

    Thanks for any extra info.

  5. stefangalen
    Member
    Posted 1 year ago #

    I change the time limit for php to 20. And this is the message that stays forever:
    The building process might still be active! Reload the page in a few seconds and check if something has changed.
    The last run didn't finish! Maybe you can raise the memory or time limit for PHP scripts.

    This is how it looks in the setting page:
    Filename of the sitemap file
    Detected Path: E:\B�stalotterna.com/sitemap.xml
    Detected URL: http://xn--bstalotterna-gcb.com/sitemap.xml

    Yes, it appears in the error log also:
    [APP_POOL_ID] => b�stalotterna.com
    and here:
    [DOCUMENT_ROOT] => E:\\B�stalotterna.com
    [INSTANCE_NAME] => B�STALOTTERNA.COM
    [SCRIPT_FILENAME] => E:\\B�stalotterna.com\\wp-admin\\options-general.php
    [APPL_PHYSICAL_PATH] => E:\\B�stalotterna.com\\
    and here:
    [PATH_TRANSLATED] => E:\\B�stalotterna.com\\wp-admin\\options-general.php

    sometimes it spells correct in the error log:
    [SERVER_NAME] => xn--bstalotterna-gcb.com

    I use this url in WordPress Address (URL) and Site Address (URL):
    http://xn--bstalotterna-gcb.com

  6. Kimberly
    Member
    Posted 1 year ago #

    Hmmmm...the "?" may just be a visual display problem (so not important) since it appears your site isnt having problems accessing those files (it knows where they are).

    Curious....in your error_log file in your root directory (so not what you see in the settings page but inside an actual file called error_log -- u will need to use a file manager to get access to it e.g. ftp) do you see a line that begins with "PHP Notice: MySQL" (or any line that uses the word "MySQL" in it)?

    ALSO can you click the debug function link (on the settings page) and scroll down to "Build Process Results" (located near the bottom of the page). Do you see any variable line that is empty or set to 0?

    I ask because as I look through the plugin source code it appears the only real way for it to give the error you are getting is via the _endTime variable being equal to 0 which only happens if an error occurred; and the only place that can happen is when it starts accessing your database.

    I am also getting curious about your server side php.ini configuration for running processes (i.e., max_execution_time) or mySQL's time limits. I will look into that later.

  7. stefangalen
    Member
    Posted 1 year ago #

    I can't find any error_log fil in the root directory. It's a windows server and I find it difficult to touch it. Do you mean the error log that comes from XML Sitemap Generator?

    Can't find any "Build Process Results", the debug function ends with "Errors, Warnings, Notices" and there is nothing there.

  8. Kimberly
    Member
    Posted 1 year ago #

    Ahhh...that's interesting. Seems there is a php fatal/exception error occurring because u should see "Build Process Results" (and a lined called "MySQL Queries"). So you are on a Windows server? Ok. I will look around for way to check up where their error logs are located. In the mean time, if u have a cpanel thing (or a user friendly gui offered by your web hoster) which you can look around for places that might indicate your server errors that will be helpful.

    Well at least i narrowed down where the error in code is happening. Might be a conflict with your domain and mySQL because this plugin forgot to encode it or something.

    I might need to give you a temporarily modified sitemap-core.php file (that is where all the work for this plugin is done) which dumps out very simple debug lines so i know how far it gets before dying..that way we can narrow what is going. At least that way we dont need to hunt around for an error_log file (if any) -- i'll just make my own that at least tells me where it is dying.

    I cant be fully sure where things fall apart...just hunches.

  9. stefangalen
    Member
    Posted 1 year ago #

    I can't find any error log newer then 121229 - even after I retried to make a new xml sitemap.

  10. Kimberly
    Member
    Posted 1 year ago #

    Ok i did a very crude change to sitemap-core.php that includes a simple call to MY_LOG(..) that writes out lines like "1", "2", and so on (doesnt write out any other info). Here is the changed file: http://speedy.sh/5CwEq/sitemap-core.php

    Can you rename your existing sitemap-core.php file and put the above file in its place and then try to rebuild your sitemap?

    What it will do is write out a file called "@MY_LOG.txt" in both the root and wp-admin area of your website. So then i should be able to access it via: http://www.bästalotterna.com/@MY_LOG.txt ... when we are done then you can delete this txt file and replace your sitemap-core.php file back to its original.

    Just in case you are wonddeirng here is the function i put in:

    function MY_LOG($data)
    {
     file_put_contents("@MY_LOG.txt",$data."<br />",FILE_APPEND);
    file_put_contents($_SERVER['DOCUMENT_ROOT']."/@MY_LOG.txt",$data."<br />",FILE_APPEND);
    }

    Notice it writes out two files. I wasnt sure if your site would have issues using $_SERVER['DOCUMENT_ROOT'] so i decided to use two file_put_contents() calls as a backup so i can either access the file from the root and if that didnt work then i can access the file via: http://www.bästalotterna.com/wp-admin/@MY_LOG.txt (assuming you kept the default plugin name the same).

  11. Kimberly
    Member
    Posted 1 year ago #

    My bad...i had a bug in the code...i updated the link above.

  12. stefangalen
    Member
    Posted 1 year ago #

    I deactivated the plugin, change name of the files, reactivated it. When I go the the setting page a totally new page shows up, with suggestion to download "sitemap-core.php"

  13. Kimberly
    Member
    Posted 1 year ago #

    Oh, that's unique. Well, you can do what i did by way of getting it to work like normal (so put back the original file and making sure it is fine) and just replacing it with my file...so without deactivating the plugin. That way it doesnt realize it has been changed. Works for me.

    I am heading out to do some shopping -- i am a girl after all :P so i will be back in 3 hrs time.

  14. stefangalen
    Member
    Posted 1 year ago #

    I tried many different ways but I always get this page with suggestion to download "sitemap-core.php"

    http://www.gadnell.com/sitemap.jpg

    It's late here in Malta. Good night!

  15. Kimberly
    Member
    Posted 1 year ago #

    Oh so that is the problem...

    Just to make sure we are on the right wavelength...

    1. You need to download the actual file that is hosted at that third party link i gave. So click the URL i give above and then click where it says "Download: sitemap-core.php" (the area above the 5 stars). This will download the actual sitemap-core.php file to your computer.

    2. Open up your server and go into the plugins folder for google-sitemap-generator.

    3. Rename the sitemap-core.php file you see in that folder to org-sitemap-core.php

    4. Upload the file that you downloaded form step #1 into this plugin folder.

    5. Now go into your WordPress admin panel and click to rebuild the sitemap

  16. stefangalen
    Member
    Posted 1 year ago #

    Okay, the two files show up where you told them to be.

  17. Kimberly
    Member
    Posted 1 year ago #

    Okay you can go ahead and put back your original sitemap-core.php file and delete those two @MY_LOG.txt files. I have the results.

    I will have a look and get back to you.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic