次のページを参考にしました。
PHPの「正しい」リダイレクト方法と、HTTPステータスコード
RaspberryPi で走る Apache2.4 と Nginxで確認しました。
index.php
<?php
$url = 'https://ekzemplaro.org/';
header('Location: ' . $url, true, 301);
exit;
?>
RaspberryPi の OS
$ uname -a
Linux violet 5.10.17-v7l+ #1414 SMP Fri Apr 30 13:20:47 BST 2021 armv7l GNU/Linux
Apache2 のバージョン
$ apachectl -v
Server version: Apache/2.4.38 (Raspbian)
Server built: 2020-08-25T20:08:29
Nginx のバージョン
$ nginx -v
nginx version: nginx/1.14.2
Nginx は php7.3-fpm とセットで使います。