• Hi when creating a new post on wordpress, and using non-english leters in the title will result in some bad permalinks.

    Lets say the title is “å – æ – ø – å – a”
    The permalink is then generated by wordpress to “……/a-æ-ø-a-a/”

    Why is only the ‘å’ letter beeing “correctly” transoformed to ‘a’ ?

    Is there a way to make

    å => aa
    ø => oe
    æ => ae

    witch is the correct non-æøå keyboard writing.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi,

    http://codex.wordpress.org/Using_Permalinks

    You can set your desired permalink from wordpress admin area and add this code in htaccess:

    # BEGIN WordPress
    
    <IfModule mod_rewrite.c>
    ErrorDocument 404 /index.php?error=404
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    Now, have a check with old and new posts for all the pages and posts.

    Thanks,

    Shane G.

    Thread Starter ahh

    (@ahh)

    Thanks, but permalinks are working..

    The problem is that worpress sugest I use ‘æ’ and ‘ø’ in the links, but it alters all ‘å’s to ‘a’s …..

    I’ve googled and googled and googled and there is STILL no solution to this problem? The guy I’m building a site for is pretty desperate about this. He says it’s a useless site if he has to make sure there are no æ’s and ø’s in the permalink for every post and page. His users are unfortunately emailing ME about 404 errors.

    Does ANYONE know when there’ll be a fix to this?

    $translate_language = array(
    	'da' => array(
    		'NOMO' => 'Dansk, Norsk',
    		'da_aeoeaa' => 'æ, ø, å &rarr; ae, oe, aa'
    	)
    );
    
    $translate_system = array();
    
    function sanitize_title_dk($title)
    {
    	global $translate_language, $translate_system;
    	if (!mb_check_encoding($title, 'ASCII'))
        {
          $title=utf8_decode($title);
          foreach (array_keys($translate_language) as $language)
            {
    		  $choise = 'da';
              switch ($choise)
              {
                case 'da':
        		$translate_system[] = array
                (
        		  "Æ"=>"ae","Ø"=>"oe","Å"=>"aa","æ"=>"ae","ø"=>"oe","å"=>"aa"
        		);
              }
    		}
    	  foreach ($translate_system as $system)
          {
    	  	$title = strtr($title, $system);
    	  }
    	}
    	return $title;
    };
    add_filter('sanitize_title', 'sanitize_title_dk', 0);

    Found this somewhere, drop it in your functions.php and problem solved. Easy.

    Where should i paste it in my wp-includes/functions.php file?
    I tried pasting it in the bottom, but that didn’t work at all.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Permalinks and non-english letters’ is closed to new replies.