Unicode Characters in page slug leads to a 404 error on a Network of sites
-
Hi!
I have a network of sites, one site for each language I’m gettinf the site translated into.
Some of the sites have problems, I think it’s because of Unicode characters in page slugs. Oddly, pages without special characters in the URl also have the same problem.
The site with the problem is at https://www.big-animals.com/pl
You can find pages using the search box, and there’s a page listed in the menu – however, clicking any link to a page produces a 404 error.
NB the pages were not created via the wordpress interface, but via a script, trying to grab the content that had been auto-translated by the GTS translation plugin.
mysql_connect(localhost,$usr,$psw); mysql_select_db($dbs); $result = mysql_query("SET NAMES utf8"); $sql = "delete from wp_5_posts where 1"; $res = mysql_query($sql); $sql = "select * from wp_gts_translated_posts where language='pl'"; $res = mysql_query($sql); while ($row = mysql_fetch_assoc($res)) { $insert = "insert into wp_5_posts "; $fields = "(post_author, post_date, post_date_gmt, post_content, post_title, post_excerpt, post_status, comment_status, ping_status, post_name, post_modified, post_modified_gmt, menu_order, post_type, comment_count)"; $val = " values "; $values = "(1, '" . $row['created_time'] . "', '" . $row['created_time'] . "', '" . addslashes($row['post_body']) . "', '" . addslashes($row['post_title']) . "', '" . $row['post_excerpt'] . "', 'publish', 'open', 'open', '" . addslashes($row['post_slug']) . "', '" . $row['modified_time'] . "', '" . $row['modified_time'] . "', 0, 'page', 0)"; $sql = $insert . $fields . $val . $values; // print($fields . "\n"); print('moving ' . $row['post_title'] . ".....\n"); $result = mysql_query($sql); print(mysql_error()); print("\n"); } mysql_close();
This script worked fine for French, Spanish, Italian, German… but not Polish… See https://www.big-animals.com/fr , for example.
I’ve tried the advice at https://semlabs.co.uk/journal/enabling-chinese-arabic-and-other-high-unicode-in-wordpress-slugs to no avail….
Help! Is there anything else left for me to try?
- The topic ‘Unicode Characters in page slug leads to a 404 error on a Network of sites’ is closed to new replies.