2016-10-18 108 views
0

我在那裏我在一個子目錄中安裝的WordPress非WordPress站點子目錄中的錯誤使用WordPress

www.example.com/wordpress/

我已經創建了WordPress的文件夾中的htaccess文件( whre我有它的所有內容)

# BEGIN WordPress 
    <IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteBase /wordpress/ 
    RewriteRule ^index\.php$ – [L] 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule . /wordpress/index.php [L] 
    </IfModule> 
    # END WordPress 

並提出在index.php文件(這個改變WordPress的文件夾中)

<?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'); 

管理員工作正常,但當試圖訪問該網站,它給了我一個錯誤500。 我在想什麼?

靈感:我想在這個網址中使用wordpress www.example.com/wordpress/ ,因爲我在根中有其他內容。

回答

0

假設你已經更新你的固定鏈接(或複製它提供給你的htaccess文件),看看你的錯誤日誌,因爲錯誤500應該會在日誌中產生一個錯誤。

對於Linux和Mac的Apache服務器,錯誤日誌,可以發現:/var/log/apache2/error_log

0

管理工作,因爲,管理員不需要htaccess的正常運行,有重寫調用它。

您的.htaccess運行在您的文件夾wordpress中,重寫它,對此文件夾有效。我每次都這樣做,我從不編輯它,除非ssl爲域啓用。

如果你index.php在你的wordpress文件夾中,你不需要像你一樣,你只需要require('wp-blog-header.php');,這些文件都在同一個文件夾中。

1

錯誤500是內部服務器錯誤 WordPress的內部服務器錯誤通常是由插件和/或主題功能引起的。在WordPress內部服務器錯誤的其他可能的原因,我們知道的是:

  • 損壞的.htaccess文件
  • PHP內存限制

可能的解決方案:

  • 檢查Corroupt .htacess
  • 增加您的PHP限制
  • 停用所有插件
  • 重新上傳core文件
  • 檢查文件權限
  • 啓用WP-調試模式