サーバー内にwordpressを導入した結果、子ドメインに入ったサイトでトップページ以外に見ることができなくなりました。
.htaccessの設定問題だと思うのですが原因が良くわからなくなってしまったのでわかる方がいらっしゃったらよろしくお願いします。
####サーバーの大まかな構成は以下になります。
site1.com-----index.php
|-.htaccess
|-wp/--index.php
| |-.htaccess
|-site2.com
####以下がその内容になります。
・site1.com/index.php
<?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__ ) . '/wp/wp-blog-header.php' );
・site1.com/.htaccess
AddHandler application/x-httpd-php53 .php # WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /wp/ RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /wp/index.php [L] </IfModule> # /WordPress # This file is made by RewriteRule Tool. # Enable RewriteEngine. RewriteEngine On RewriteEngine on RewriteCond %{HTTP_HOST} ^www.site1.com RewriteRule (.*) http://site1.com/$1 [R=301,L] Options FollowSymLinks RewriteEngine on RewriteCond %{THE_REQUEST} ^.*/index.php RewriteRule ^(.*)index.php$ http://site1.com/$1 [R=301,L] # Main RewriteRule for multidomain. RewriteCond %{HTTP_HOST} ^(site2.com) RewriteCond %{REQUEST_URI} !^/(site2.com)/ RewriteRule ^(.*)$ /%{HTTP_HOST}/$1/ [L] #存在しないページのアクセスをTOPページにリダイレクト[1] #ErrorDocument 404 http://site1.com/ # 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
・site1.com/wp/index.php
<?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__ ) . '/wp-blog-header.php' );
・site1.com/wp/.htaccess
AddHandler application/x-httpd-php53 .php # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /wp/ RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /wp/index.php [L] </IfModule> # END WordPress
あなたの回答
tips
プレビュー