LoginSignup
0
0

More than 1 year has passed since last update.

WordPressが返すURLを指定する方法

Posted at

はじめに

リバースプロキシ環境下などの場合に,
WordPressがレスポンスするURLを変更したいことがあります.
備忘録として設定方法を残します.
※WordPressのデータベースはMySQLを使用することを前提としています.

方法

MySQLに入ります.

$ mysql -u root -p
mysql>

WordPressのデータベースを選択します.

mysql> use wordpress;

レスポンスしたいURLを2箇所に設定します.

mysql> update wp_options set option_value = "http://abc.xxx.jp/" 
where option_name = 'siteurl';

mysql> update wp_options set option_value = "http://abc.xxx.jp/" 
where option_name = 'home';

設定が反映されていることを確認します.

mysql> select * from wp_options where option_name = 'home';
+-----------+-------------+---------------------------------+----------+
| option_id | option_name | option_value                    | autoload |
+-----------+-------------+---------------------------------+----------+
|         2 | home        | http://abc.xxx.jp/              | yes      |
+-----------+-------------+---------------------------------+----------+
1 row in set (0.00 sec)

sql> select * from wp_options where option_name = 'siteurl';
+-----------+-------------+---------------------------------+----------+
| option_id | option_name | option_value                    | autoload |
+-----------+-------------+---------------------------------+----------+
|         2 | home        | http://abc.xxx.jp/              | yes      |
+-----------+-------------+---------------------------------+----------+
1 row in set (0.00 sec)

反映されているのを確認したら,一応phpなどのWordPress関連のミドルウェアを再起動しておくことをお勧めします.

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