私は実際には小さな会社のWebサイトで作業しています。最初は、私のワードプレスWebサイトがインストールされているサブディレクトリ(「サイト」と呼ばれていました)についていくつかのテストを行っていました。私は最終的にすべてのコンテンツをルートディレクトリに移動せずに自分のWebサイトを展開したかったということです。ちなみに、私はこのチュートリアルhttps://codex.wordpress.org/Giving_WordPress_Its_Own_Directoryを見つけて、私は完全にWordPressに精通していないのでそれに続きます。WordPress:index.phpでのエラー500のみ
これで、www.mywebsite.fr/index.php/page/を実行しているすべてのページにアクセスできます。しかし、問題は私がメインページ( "index.php/page /"や "/ page /"なし)にアクセスできないということです。 それはエラー500
.htaccessファイル(ルートディレクトリ)
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /site/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /site/index.php [L]
</IfModule>
# END WordPress
の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__) . '/site/wp-blog-header.php');
の.htaccess( '/サイト' ディレクトリ)
を返し続けますRewriteEngine On
RewriteBase /site/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /site/index.php [L]
index.php( '/ site'ディレクトリ)
<?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');
そして、クライアントのウェブサイトは、PHPログなしでホスティングしています。 誰かがアイデアを持っていますか? (私の英語のため申し訳ありません。)
回答ありがとうございます!あなたの.htaccessは正しいものでした。ルートディレクトリのindex.phpは問題なく、変更する必要はありませんでした。今のところうまくいく –