Encodings for cyrillic links
-
Hello All,
I have migrated a wordpress site to on another server and domain. The first page loads well. However when I start clinking on sub-menus which are Cyrillic, they are failing with:
“The requested URL /за-наÑ/ was not found on this server.”
I wonder where I should look at. Database, server OS or all-in-one plugin encoding.
Thank you !
LyuboThe page I need help with: [log in to see the link]
-
Hi
What is your web server?
Apache 2.4.25 on Debian.
I’ve just tried adding “AddDefaultCharset off” in apache configuration for this specific vhost, but without much difference.
Lyubo
Here is what browser debug console shows:
Response headers (216 B)
Connection
Keep-Alive
Content-Length
296
Content-Type
text/html; charset=iso-8859-1
Date
Sun, 03 Dec 2017 10:44:36 GMT
Keep-Alive
timeout=5, max=96
Server
Apache/2.4.25 (Debian)
Request headers (748 B)
Accept
text/html,application/xhtml+xm…plication/xml;q=0.9,*/*;q=0.8
Accept-Encoding
gzip, deflate
Accept-Language
en-US,en;q=0.5
Cache-Control
no-cache
Connection
keep-alive
Cookie
wordpress_test_cookie=WP+Cooki……..30c437b
Host
urbana.lyubo.info
Pragma
no-cache
Referer
http://urbana.lyubo.info/
Upgrade-Insecure-Requests
1
User-Agent
Mozilla/5.0 (Macintosh; Intel …) Gecko/20100101 Firefox/57.0Lyubo
Source site:
Request Headers:
Accept-Language: en-usResponse Headers:
Content-Type: text/html; charset=UTF-8Destination site:
Request Headers:
Accept-Language: en-usResponse Headers:
Content-Type: text/html; charset=iso-8859-1It seems like charset has been changed from UTF-8 to iso-8859-1 after moving the site. This is reported in response headers.
- This reply was modified 6 years, 4 months ago by ljbomir.
I’ve noticed the first page on destination site uses UTF8. That must be the reason it works well. When I click on any of the links, charset is being changed to “iso-8859-1”. Checking the original source site, all links and main page are using UTF8.
- This reply was modified 6 years, 4 months ago by ljbomir.
Hi
Thanks for the info! I think the problem could be related to the database, can you check database encoding, it should be utf8_general_ci?
Thank you for your reply.
It was set to latin1 (8859-1).
MariaDB [(none)]> SHOW CREATE DATABASE urbana_bg;
+———–+———————————————————————-+
| Database | Create Database |
+———–+———————————————————————-+
| urbana_bg | CREATE DATABASEurbana_bg
/*!40100 DEFAULT CHARACTER SET latin1 */ |
+———–+———————————————————————-+
1 row in set (0.00 sec)Then I changed it to UTF8.
MariaDB [(none)]> alter database urbana_bg collate=’utf8_general_ci’;
Query OK, 1 row affected (0.00 sec)Then verified it is applied.
MariaDB [(none)]> SHOW CREATE DATABASE urbana_bg;
+———–+——————————————————————–+
| Database | Create Database |
+———–+——————————————————————–+
| urbana_bg | CREATE DATABASEurbana_bg
/*!40100 DEFAULT CHARACTER SET utf8 */ |
+———–+——————————————————————–+
1 row in set (0.00 sec)But the links are still crashing and I still get the 8859-1 charset in the header response.
text/html; charset=iso-8859-1
Hi
Can you try to re-import same backup file but with the new database encoding?
Yes, I have just tried:
1. drop database if exists urbana_bg;
2. create database urbana_bg character set=’utf8′ collate=’utf8_general_ci’;
3. Import the export againBut I am still getting the 8859-1 encoding when I click on any page and crashing.
Hi
One more question, can you verify wp-config.php for define(‘DB_CHARSET’, ‘utf8’);
Hi
–I’ve added these manually in wp-config.
define( ‘DB_CHARSET’, ‘utf8’ );
define(‘DB_COLLATE’, ‘utf8_general_ci’);Without much result.
–I’ve verified the charset of exported db dump:
CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=44
Then I dropped and recreated the database with these exact encodings just to match with the source.
— Verified php configuration is set to UTF8
$grep ^default_charset $(locate php.ini)
/etc/php/7.0/apache2/php.ini:default_charset = “UTF-8”
/etc/php/7.0/cli/php.ini:default_charset = “UTF-8”
/etc/php5/apache2/php.ini:default_charset = “UTF-8”
/etc/php5/apache2filter/php.ini:default_charset = “UTF-8”
/etc/php5/cli/php.ini:default_charset = “UTF-8”
/etc/php5/fpm/php.ini:default_charset = “UTF-8”
/usr/lib/php/7.0/php.ini-development:default_charset = “UTF-8”
/usr/lib/php/7.0/php.ini-production:default_charset = “UTF-8”
/usr/lib/php/7.0/php.ini-production.cli:default_charset = “UTF-8”—Tried forcing “AddDefaultCharset UTF-8” in /etc/apache2/conf-enabled/charset.conf
—Added
header(‘Content-type: text/html; charset=UTF8’);
in
/wp-content/themes/lychee/header.phpStill the same issue.
I am starting to suspect there must be something within the php files inside the wordpress directory, which is setting it to iso-8859-1
Thanks,
LyuboHi
I see, could you please contact support [at] servmask.com for further investigation?
Hi,
I have finally managed to resolve it by changing AllowOverride None for /var/www/ to AllowOverride All in /etc/apache2/apache2.conf !
Credit:
https://wordpress.stackexchange.com/a/209464Thank you!
Lyubo- This reply was modified 6 years, 4 months ago by ljbomir.
- The topic ‘Encodings for cyrillic links’ is closed to new replies.