• Hi all!
    In my website I’ve some page/post that in URL have characters like “à“, “è“, “” and so on.
    When I save, automatically the URL is modified in “a“, “e“, etc.
    Instead, I need that special characters are showed in URL.
    I’ve tried modifying permalink but nothing, automatically the character is changed.
    Please, can you help me?

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • This is done because special characters like that are unsafe, as in, they might not show up properly in certain browsers/OS’s.

    WordPress automatically makes the URL “safe”, so that it will work for everyone.

    Same happens for characters like “&”, which WordPress will remove from the permalink URL.

    Thread Starter xmas83

    (@xmas83)

    Yes, I appreciate it, but only temporarily (24 hours) I need that special characters.
    How can I do? Is there a way?

    You could create a static HTML/PHP file, save it with a filename that contains special characters, and use it to redirect to the actual page.

    For example, you have a page called “The letter à is awesome”. It will be saved at (for example) https://www.mysite.com/the-letter-a-is-awesome.

    So create a file called the-letter-à-is-awesome.php with these contents:

    header("Location: https://www.mysite.com/the-letter-a-is-awesome");
    die();

    Maybe not perfect, but that’s a way you could try.

    Thread Starter xmas83

    (@xmas83)

    It doesn’t work or, probably, I can’t do it.
    I’ve created the php file; it contains

    header("Location: https://medicinapertutti.altervista.org/argomento/rigor-mortis-o-rigidita-cadaverica/");
    die();

    The file is called rigor-mortis-o-rigidità-cadaverica.
    I put the php in root of my webspace but if I go to
    https://medicinapertutti.altervista.org/argomento/rigor-mortis-o-rigidità-cadaverica, I’ve 404 error.

    That’s because it’s still looking for a WordPress page with that name. You’ll need to give the file a .PHP extension (so call it rigor-mortis-o-rigidità-cadaverica.php), and if you put it in the root of your site, you’ll need to access it through https://medicinapertutti.altervista.org/rigor-mortis-o-rigidità-cadaverica.php (don’t include the “argomento” part in the URL).

    If all that doesn’t work, it’s likely that the special character in the filename is the reason why it’s not working.

    Thread Starter xmas83

    (@xmas83)

    Ahhh! However it doesn’t solve my problem because I need that users find URL with special character, not me. ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Special character in URL’ is closed to new replies.