• Resolved Dariusz

    (@idarek)


    Hello,
    I have just migrated a site from Drupal to WordPress.
    Everything working fine, apart from one problem with links already shared to the internet.

    Site is in Polish, and somebody who set this in Drupal decided that permlinks will contain Polish characters / accents like. ?????? in link.

    Wordpress not using this methide, and now all link are exactly that same but without polish charactes.

    ? is l
    ? is e

    Which is fine.
    Can somebody help to create generic (not link specific) Rewrite rule to match link with accents with the same link without accents. If not possible, I will try to match each link, but that’s more time-consuming.

    Example:
    DRUPAL: https://antybariera.pl/noworoczne-ha?asy/
    WORDPRESS: https://antybariera.pl/noworoczne-halasy/

    Wordpress do not match them sue to accented character “?”

    Thanks.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello Dariusz,

    I hope you are doing well – I noticed this post has been open for a while without a reply.

    Would something like this work for your situation:

    https://stackoverflow.com/questions/18673576/replace-special-character-in-htaccess

    RewriteEngine On
    RewriteRule ^(.*)?(.*)$ /$1a$2 [L,R=302]
    RewriteRule ^(.*)?(.*)$ /$1e$2 [L,R=302]
    RewriteRule ^(.*)?(.*)$ /$1s$2 [L,R=302]
    RewriteRule ^(.*)?(.*)$ /$1c$2 [L,R=302]
    RewriteRule ^(.*)ó(.*)$ /$1o$2 [L,R=302]

    It is not link specific but it is character specific (and sadly my familiarity with the Polish alphabet is none) – that is, I am not sure if you would have more Rewrite Rules to replace Polish characters or to remap each URL, but hopefully rewriting the characters results in fewer rules.

    While testing/refining the rules, I recommend using 302 redirects instead of 301. Once all is working as expected, you can replace the 302s with 301s.

    Let me know if that helps and how things go.

    Thank you,
    -Neil

    Apologies for the double reply – I neglected to mention that those rewrite directives should be added to the top of your .htaccess file (above the WordPress section if it exists.

    Thanks,
    -N

    Thread Starter Dariusz

    (@idarek)

    Hello @nsabol
    Thank you very much. Your replay, especially second one was what I was looking for. I have tried rewrite method mentioned by you before but without luck and been very sceptic about that. As I have been adding it to the end of the file, it didn’t work. Passing it as a first thing solve the problem. Now I can sort out other redirections in an ordinary way.

    Once again, big THANK YOU.

    • This reply was modified 6 years, 8 months ago by Dariusz.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Redirect old accented url (Drupal) to match new (WordPress)’ is closed to new replies.