【发布时间】:2016-09-11 02:35:42
【问题描述】:
我有一个现有的 WordPress 网站,可以在本地和在线服务器上正常运行。我只想将我的网站移动到 Heroku。 我已经按照 this 教程部署到 Heroku。
但是,当我访问 myappname.herokuapp.com 时,它要求我重新安装 WordPress。我该如何解决这个问题?
我删除了/wp-admin/import.php、/wp-admin/install.php、/wp-admin/install-helper.php、/wp-admin/upgrade.php和/wp-admin/upgrade-functions.php。
/wp-config.php:
/** This should point to the app directory */
define('WP_SITEURL', "http://" . $_SERVER["HTTP_HOST"]);
/** This is the URL your visitors will see */
define('WP_HOME', "http://" . $_SERVER["HTTP_HOST"]);
define( 'WP_CACHE', true );
define( 'WPLANG', 'vi_VI' );
$url = parse_url(getenv('DATABASE_URL') ? getenv('DATABASE_URL') : getenv('CLEARDB_DATABASE_URL'));
/** The name of the database for WordPress */
define('DB_NAME', trim($url['path'], '/'));
/** MySQL database username */
define('DB_USER', $url['user']);
/** MySQL database password */
define('DB_PASSWORD', $url['pass']);
/** MySQL hostname */
define('DB_HOST', $url['host']);
/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');
/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');
/.htaccess:
# 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
【问题讨论】:
标签: php wordpress .htaccess heroku