このユーザーにはお気に入りのトピックがありません。
お気に入りのフォーラムトピック
作成したフォーラムトピック
| ステータス |
トピック
|
サポーター | 声 | 投稿 | 新着度 |
|---|---|---|---|---|---|
|
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日、 9時間前 | |
|
My manual translation isn't displaying in correct language
開始者:sarahD-3 カテゴリ:English Support |
|
3 | 9 |
3年、 10ヶ月前
sarahD-3 |