| @@ -195,8 +195,15 @@ | ||
| 195 | 195 | return; |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | $request_path = parse_url($url, PHP_URL_PATH) ?? '/'; |
| 199 | + $extension = strtolower(pathinfo($request_path, PATHINFO_EXTENSION)); | |
| 200 | + $allowed_extension = ['html', 'htm']; | |
| 201 | + | |
| 202 | + if (!empty($extension) && !in_array($extension, $allowed_extension)) { | |
| 203 | + return; | |
| 204 | + } | |
| 205 | + | |
| 199 | 206 | if ($request_path !== '/' && isset($configs['permalink_trailing_slash']) && $configs['permalink_trailing_slash'] !== null) { |
| 200 | 207 | $has_trailing_slash = substr($request_path, -1) === '/'; |
| 201 | 208 | if ($configs['permalink_trailing_slash'] !== $has_trailing_slash) { |
| 202 | 209 | bwp_redirect_to_canonical_slash($configs['permalink_trailing_slash']); |