Permalink.create Not working with Arabic slug!

AI-generated summary

In a migration-related discussion about bbpress, hiccup reports that Permalink.create fails when using Arabic slugs (e.g., /Arabic-title), even though it works for English slugs — despite the permalink being created, the link returns a “not found” error. This is critical because over 12,000 external backlinks rely on these Arabic slugs. As a workaround, hiccup uses .htaccess 301 redirects from the old server to the new Discourse topic IDs, but is concerned about performance due to the 2MB .htaccess file size. pfaffman suggests testing minimal Arabic slugs, verifying leading slashes, and notes that the old server’s redirects shouldn’t impact new site performance since traffic only hits the old server for 301s. pfaffman also speculates this may be a bug related to RTL or untested Arabic support, suggesting debugging core or testing reversed slugs. hiccup confirms the old server has a different hostname, acknowledges the workaround works, and considers abandoning Permalink.create for Arabic slugs due to the unresolved issue.

Hi

Simply my old bbpress used only slugs within Arabic characters no id only /post-title

Therefore, when trying to use Permalink.create(url: '/Arabic-title', topic_id: 3708), Permalink is being created, but the link is not working, and it gives the link that it does not exist

The problem is that I have more than 12,000 links spread across the Internet that use Arabic slugs, I don’t need to lose all these backlinks.

I am currently using htaccess on the old server to redirect 301(/Arabic-title TO newdiscourse/t/topic_id ), but with 12,000 links, the file size has become 2MB, and I am worried that it may make the redirect 301 slow, but everything works fine

Any suggestion, please?

What I would do is start with a trivial example with just a character or two. I can’t remember if the URL is supposed to start with a leading // or whether it matters (it likely does not, but it’s the first thing I’d try).

Indeed, I have tried Permalink.create with 2 or 3 links, and I have tried with // and without, but the same Permalink.create for English links works, but if the link uses Arabic slugs, it does not work..

So the old server and the new one have different host names? I’d probably stick with that. It can’t matter much if the 301s are slow on the old server since only 301 are going there.

If no one from team chimes in, the next thing you could do would be to try to add don’t debugging to core to see exactly what it’s looking for. It’s conceivable that it is a bug, as Arabic may not be tested and rtl could play in some way. (That’s all speculation.) Maybe try a 3 character slug backward?

I really appreciate your reply. @pfaffman

Sure, the old server have different host name and only host htaccess file with 12k old links redirect 301 and work fine. Like I said am only worried about the redirect speed.

I believe should I skip use permalink option