WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Keeping special characters in migrated permalinks without causing a 404 (3 posts)

  1. harvitronix
    Member
    Posted 2 years ago #

    I've recently migrated a decent sized site from Drupal to WordPress and as part of it, I've migrated the permalink structure for SEO purposes.

    The problem now is that special characters do not seem to be supported in permalinks the way they were in Drupal.

    Example URL:
    mysite.com/stories/la-niña-is-back

    This works fine in Drupal. In WordPress, it produces a 404. There are about 9,000 posts, so doing anything manually is out of the question. Also, I would rather not replace all the special characters in the permalinks for SEO purposes (or I'm going to have to create a forwarding table, which I suppose would be the last resort).

    So the question is: Is there any way to force WordPress to allow special characters in permalinks without 404ing, the way Drupal allows them?

    Thank you very much for any help you can provide.
    Matt.

  2. harvitronix
    Member
    Posted 2 years ago #

    Anyone have an idea on this one?

    There's gotta be a way to force WordPress to allow non-English characters? It's way above my programming abilities.

    Would really appreciate any help!

    Thank you.
    Matt.

  3. harvitronix
    Member
    Posted 1 year ago #

    For future browsers of this thread, I was able to fix the issue by rewriting the url using htaccess. Turns out that if you change a ñ to a n, WordPress finds the correct page.

    Here are the rewrite rules I used:
    RewriteRule ^(.*)ñ(.*)$ /$1n$2 [R=301,L]
    RewriteRule ^(.*)å(.*)$ /$1a$2 [R=301,L]
    RewriteRule ^(.*)’(.*)$ /$1$2 [R=301,L]
    RewriteRule ^(.*)ø(.*)$ /$1o$2 [R=301,L]
    RewriteRule ^(.*)—(.*)$ /$1-$2 [R=301,L]
    RewriteRule ^(.*)ä(.*)$ /$1a$2 [R=301,L]
    RewriteRule ^(.*)é(.*)$ /$1e$2 [R=301,L]
    RewriteRule ^(.*)ü(.*)$ /$1u$2 [R=301,L]

    Matt.

Topic Closed

This topic has been closed to new replies.

About this Topic