Synology WordPress をルートディレクトリに配置する

設定メニューの一般設定タブから、サイトアドレス(URL)をルートディレクトリに変更する。
具体例は次のとおり。
【変更前】http://home.ne.jp/wordpress
【変更後】http://home.ne.jp
変更後に、「変更を保存」ボタンをクリックする。

/wordpress のディレクトにある次のファイルをルートディレクトリに移動する。
(1)index.php
(2).htaccess
それぞれの内容を確認して、ハイライトの行のとおり変更を行う。

<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/

/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define('WP_USE_THEMES', true);

/** Loads the WordPress Environment and Template */
require( dirname( __FILE__ ) . '/wordpress/wp-blog-header.php' );
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

シェアする

  • このエントリーをはてなブックマークに追加

フォローする