dongliang9682 2016-11-12 01:37
浏览 60

在单独的子目录中为具有Wordpress和主题文件的站点设置本地环境?

I'm at a total loss here. I've never seen a Wordpress site setup with the wp-content files and the wordpress install files in separate sub-directories. Here's a snapshot of the root directory so you can see the file directories. The content folder includes the parent and child theme, and the wp folder includes the wordpress install.

snapshot of directory

I'm using a MAMP as my local environment, and I've grabbed the live site files via SFTP. At the root of the directly is an .htaccess file, local-config.php and wp-config.php. For my local setup, I want to host this site at localhost:8888/{ project name }, however the config files aren't connecting for me.

This is what local-config.php includes:

<?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
 */

 // Must have a trailing and leading slash // define('WP_SUBURI',
 '/mysite/');

 define( 'DB_NAME', 'icecreamstore_wp' ); define( 'DB_USER', 'root' );
 define( 'DB_PASSWORD', 'root' ); define( 'DB_HOST', 'localhost' );

 // Comma separated list of hostnames which should be considered
 "local" // and re-written to $_SERVER['HTTP_HOST']. Also addresses
 wp-content => content replacement. define( 'PATHFIX',
 'local.icecreamstore.maine.edu, icecreamstore.maine.edu'
 );

 // WP_ENV sets the environment to be used by the wp-env MU plugin //
  defined( 'WP_ENV', 'development' );

 // Maintenance mode using the maintenance mu-plugin // define(
 'MAINTENANCE', false); // define( 'MAINTENANCE', true); // define(
 'MAINTENANCE', '<h1>Custom message</h1><p>For maintenance mode</p>');

 // $table_prefix = 'wp_';

 // If the keys are defined here, they will not be loaded in
 wp-config.php

 { security and authentication below this line... }

And the wp-config.php site includes:

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

 // ========================
 // Security
 // ========================
 if ( !defined('DISALLOW_FILE_EDIT') )
   define('DISALLOW_FILE_EDIT', TRUE);
 if ( !defined('DISALLOW_FILE_MODS') )
   define('DISALLOW_FILE_MODS', FALSE);

 // ========================
 // Custom Content Directory
 // ========================
 define('WP_CONTENT_DIR', dirname( __FILE__ ) . '/content' );

 if ( !defined('WP_SUB_URI') )
   define('WP_SUBURI', '/');

 define('WP_CONTENT_URL', 'http://' . $_SERVER['HTTP_HOST'] . WP_SUBURI   . 'content' );

 /** dynamically set siteurl and home options */
 define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . WP_SUBURI . 'wp');
 define('WP_HOME',    'http://' . $_SERVER['HTTP_HOST'] . WP_SUBURI);

 { security and authentication below... }

And just in case it helps, the .htaccess at the root includes:

 # 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

Help! I haven't found anyone online with this particular issue of having to take a live site setup this way, and create a local environmnet for testing. The downside: The previous developer didn't include anything in the README.md docs.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 使用C#,asp.net读取Excel文件并保存到Oracle数据库
    • ¥15 C# datagridview 单元格显示进度及值
    • ¥15 thinkphp6配合social login单点登录问题
    • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
    • ¥15 如何在scanpy上做差异基因和通路富集?
    • ¥20 关于#硬件工程#的问题,请各位专家解答!
    • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
    • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
    • ¥30 截图中的mathematics程序转换成matlab
    • ¥15 动力学代码报错,维度不匹配