У этого пользователя нет избранных тем.
Избранные темы форума
Созданные темы форума
| Статус |
Тема
|
Специалист поддержки | Голоса | Сообщения | Свежесть |
|---|---|---|---|---|---|
|
CRITICAL BUG FOUND: REST API endpoints broken in translated language directories
1
2
Начато: sarahD-3
в: English Support
Problem:
<ifmodule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /en/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /en/index.php [L]
</ifmodule>
This occurs primarily on a specific page and happens on every heartbeat. This happens when third-party plugins call the flush_rewrite_rules(true) function too often. This can change the rewrite rules in your .htaccess file and cause issues on your WordPress site. The full explanation can be found here: We suggest implementing the workaround on your staging site by adding the following function to the theme's functions.php file.
add_filter('mod_rewrite_rules', 'fix_rewritebase');
function fix_rewritebase($rules){
$home_root = parse_url(home_url());
if ( isset( $home_root['path'] ) ) {
$home_root = trailingslashit($home_root['path']);
} else {
$home_root = '/';
}
$wpml_root = parse_url(get_option('home'));
if ( isset( $wpml_root['path'] ) ) {
$wpml_root = trailingslashit($wpml_root['path']);
} else {
$wpml_root = '/';
}
$rules = str_replace("RewriteBase $home_root", "RewriteBase $wpml_root", $rules);
$rules = str_replace("RewriteRule . $home_root", "RewriteRule . $wpml_root", $rules);
return $rules;
}
Relevant Documentation: |
|
0 | 18 | 5 дней назад | |
|
My manual translation isn't displaying in correct language
Начато: sarahD-3 в: English Support |
|
3 | 9 |
3 года, 10 месяцев назад
sarahD-3 |