LoginSignup
0
0

More than 1 year has passed since last update.

PHP でリダイレクト (Apache2,Nginx)

Last updated at Posted at 2020-06-19

次のページを参考にしました。
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 とセットで使います。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0