简体   繁体   English

Media Temple上的WordPress:“重定向过多”错误

[英]WordPress on Media Temple: “too many redirects” error

I have a WordPress site that I am moving to a Media Temple Grid Server from another provider. 我有一个WordPress网站,我正从另一家提供商迁移到Media Temple Grid Server。 I have WordPress in its own 'wp' directory so I can update it independent of the rest of my codebase. 我在自己的“ wp”目录中有WordPress,因此我可以独立于代码库的其余部分进行更新。

After uploading all the files, I went to my site's URL, expecting that WordPress would start its install process, but instead, it redirects from http://example.com to http://example.com/wp-admin/install.php , and the browser gives me a "too many redirects" error message. 上传完所有文件后,我转到了我网站的URL,期望WordPress将开始其安装过程,但是它从http://example.com重定向到http://example.com/wp-admin/install。 php ,浏览器给我“太多重定向”错误消息。

Other things: 其他事情:

  • The database is created 数据库已创建
  • The .htaccess file has all the WordPress rules .htaccess文件具有所有WordPress规则

Here's my wp-config.php: 这是我的wp-config.php:

    <?php
    // ===================================================
    // Load database info and local development parameters
    // ===================================================
    if ( file_exists( dirname( __FILE__ ) . '/wp-config-local.php' ) ) {

        define( 'WP_LOCAL_DEV', true );
        define( 'WP_DEBUG', true );
        define( 'WP_DEBUG_LOG', true );
        define( 'WP_DEBUG_DISPLAY', true );

        require( 'wp-config-local.php' );

    } elseif ( file_exists( dirname( __FILE__ ) . '/wp-config-staging.php' ) ) {

        define( 'WP_LOCAL_DEV', false );
        define( 'WP_DEBUG', true );
        define( 'WP_DEBUG_LOG', true );
        define( 'WP_DEBUG_DISPLAY', true );

        require( 'wp-config-staging.php' );

    } elseif ( file_exists( dirname( __FILE__ ) . '/wp-config-production.php' ) ) {

        define( 'WP_LOCAL_DEV', false );
        define( 'WP_DEBUG', false );

        require( 'wp-config-production.php' );
    }

    // ========================
    // Custom Content Directory
    // ========================
    define( 'WP_CONTENT_DIR', dirname( __FILE__ ) . '/content' );
    define( 'WP_CONTENT_URL', 'http://' . $_SERVER['HTTP_HOST'] . '/content' );

    // ================================================
    // You almost certainly do not want to change these
    // ================================================
    define( 'DB_CHARSET', 'utf8' );
    define( 'DB_COLLATE', '' );

    // ==============================================================
    // Salts, for security
    // Grab these from: https://api.wordpress.org/secret-key/1.1/salt
    // ==============================================================
    define('AUTH_KEY',         '+jw|C|KUKW4.&062<MjcDr/a95AOdg$tH5N^7-arnWXWD$V=5+RUUe-#YNW<~INo');
    define('SECURE_AUTH_KEY',  'Tu?%@u{.<-9^8Qi+wtB-X;5`-b!(4U)#:B`4?~-R,.,H~kTyCRX#b[Rf@V9m/,DW');
    define('LOGGED_IN_KEY',    'Kf_!-|N|kII`+:j7x2~QBQR_nVQ/ uvCPif/$|wk})lm YR{Y^8qji/X![jljpE]');
    define('NONCE_KEY',        'YA+GiHY&N<)Gh`f-KR 0+BF4I]jP-Tn.b+V-Z1+}/P!B+:Lfr~(qB(u$_QCaUFM6');
    define('AUTH_SALT',        'U96${|%&HN-l)aP.*.@ZK2&nIp@l~3X0-{Rx$Fgll4oY&-YM/UVw9bf<Tyk=S@v>');
    define('SECURE_AUTH_SALT', '>f-^11d$V|M#bm2K.Rzk1i=H+Ykpv`9lVgsBd+}W5&@rS_!k=EZsy0-]&S3!sNk[');
    define('LOGGED_IN_SALT',   '#2iH05hI2h87P:a!}`jsqH3>E#q0g)|Ns9g{T;($S%,n>+dP)W-l9{@whhnib:1Q');
    define('NONCE_SALT',       '_I90W[ST<|bmKC<i*J.-tq+R+wqyAkUd-~33*E?k!:%O3)rRZ~yc-PpVA<R+OcTR');

    // ==============================================================
    // Table prefix
    // Change this if you have multiple installs in the same database
    // ==============================================================
    $table_prefix  = 'wp_';

    // ================================
    // Language
    // Leave blank for American English
    // ================================
    define( 'WPLANG', '' );

    // ===========
    // Hide errors
    // ===========
    ini_set( 'display_errors', 0 );
    define( 'WP_DEBUG_DISPLAY', false );

    // =================================================================
    // Debug mode
    // Debugging? Enable these. Can also enable them in local-config.php
    // =================================================================
    // define( 'SAVEQUERIES', true );
    // define( 'WP_DEBUG', true );

    // ======================================
    // Load a Memcached config if we have one
    // ======================================
    if ( file_exists( dirname( __FILE__ ) . '/memcached.php' ) )
        $memcached_servers = include( dirname( __FILE__ ) . '/memcached.php' );

    // ===========================================================================================
    // This can be used to programatically set the stage when deploying (e.g. production, staging)
    // ===========================================================================================
    define( 'WP_STAGE', '%%WP_STAGE%%' );
    define( 'STAGING_DOMAIN', '%%WP_STAGING_DOMAIN%%' ); // Does magic in WP Stack to handle staging domain rewriting

    // ===================
    // Bootstrap WordPress
    // ===================
    if ( !defined( 'ABSPATH' ) )
        define( 'ABSPATH', dirname( __FILE__ ) . '/wp/' );
    require_once( ABSPATH . 'wp-settings.php' );

And here's wp-config-production.php: 这是wp-config-production.php:

    <?php
    /*
    This is a sample local-config.php file
    In it, you *must* include the four main database defines

    You may include other settings here that you only want enabled on your local development checkouts
    */

    define( 'DB_NAME', 'db000000_wordpress' );
    define( 'DB_USER', 'db000000' );
    define( 'DB_PASSWORD', 'some_password' );
    define( 'DB_HOST', 'internal-db.s000000.gridserver.com' ); // Probably 'localhost'

Any thoughts on what I'm doing wrong? 对我在做什么错有任何想法吗?

解决了这个问题-原来我上次安装时上传了一个.htaccess文件,并且该文件正在进行一些重写,从而导致重定向问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM