新WP変更&ディレクトリ変更手順メモ
新WP変更&ディレクトリ変更手順メモ
やること
http://hoge.com/wp
でテストサーバーで動いていたものを
http://hoge.com/
で動かす
require( dirname( __FILE__ ) . '/wp-blog-header.php' );
を
require( dirname( __FILE__ ) . '/wp/wp-blog-header.php' );
に変更
RewriteBase と RewriteRule に注意
# 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
http://hoge.com/wp
から
http://hoge.com
に変更
functions.phpに追記する
remove_action( 'template_redirect', 'wp_redirect_admin_locations', 1000 );