更改站点 URL 不起作用 Wordpress [英] Changing The Site URL doesn't work Wordpress

查看:31
本文介绍了更改站点 URL 不起作用 Wordpress的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在更改 Wordpress 中的站点 URL 时遇到问题.我不知道我做错了什么.我从 fryzjer.make4u.pl 复制了我的网站.我创建了子域 demo1.make4u.pl 并从 fryzjer.make4u.pl 中取出了我的文件.当我进入 demo1.make4u.pl 时,将我重定向到 fryzjer.make4u.pl.我更改文件 wp-config.php 中的代码

s[4~f');定义('SECURE_AUTH_KEY', '*m0QP$nkR1p(DKM?mQvl5h`yI%8TcdNCE,S!Kdu9I6a~:&Wu/nXV?9pKW1n!&2xw');define('LOGGED_IN_KEY', 'ekZe)AMW@r[rux$OB2WH<`B_l*+$[v8:^bNGqjps+kEF!|ENpm5gN<]8)p7cg7QE');定义('NONCE_KEY', 'dC1q%} tFWkT-}I*H60wA|lf);Z1m9bV]G;*qwc/');定义('LOGGED_IN_SALT', 'GeDCcC$uR^6e(4(TjF94N$Yh

你知道为什么它不起作用吗?

解决方案

您定义了错误的常量.wp-config.php 文件的顶部应该是:

define('HOME','http://demo1.make4u.pl');定义('SITEURL','http://demo1.make4u.pl');

请注意,WP_HOME 变成了 HOMEWP_SITEURL 变成了 SITEURL.>

或者,如果这对您不起作用,请尝试连接到数据库,导航到 wp_options 表,并调整 homesiteurl 的条目 到您的新网址.

如果您有信心在数据库上使用 SQL 查询,则可以使用 if yuyokk 的代码作为 SQL 查询这将在您的数据库中进行全面的查找/替换:

记住: 在尝试任何 SQL 查询之前备份您的数据库!

更新 wp_optionsSET option_value = 'http://demo1.make4u.pl'WHERE option_name = 'home';更新 wp_optionsSET option_value = 'http://demo1.make4u.pl'WHERE option_name = 'siteurl';更新 wp_postsSET post_content = REPLACE(post_content,'http://fryzjer.make4u.pl','http://demo1.make4u.pl');更新 wp_postsSET guid = REPLACE(guid,'http://fryzjer.make4u.pl','http://demo1.make4u.pl');

I have a problem with Changing The Site URL in Wordpress. I don't know what I'm doing wrong. I copy my website from fryzjer.make4u.pl. I created subdomen demo1.make4u.pl and took out my files from fryzjer.make4u.pl. When I enter to demo1.make4u.pl redirection me to fryzjer.make4u.pl. I change code in file wp-config.php

<?php
/**
 * The base configuration for WordPress
 *
 * The wp-config.php creation script uses this file during the
 * installation. You don't have to use the web site, you can
 * copy this file to "wp-config.php" and fill in the values.
 *
 * This file contains the following configurations:
 *
 * * MySQL settings
 * * Secret keys
 * * Database table prefix
 * * ABSPATH
 *
 * @link https://codex.wordpress.org/Editing_wp-config.php
 *
 * @package WordPress
 */
// ** MySQL settings - You can get this info from your web host ** //
define('WP_HOME','http://demo1.make4u.pl');
define('WP_SITEURL','http://demo1.make4u.pl');


/** The name of the database for WordPress */
define('DB_NAME', 'pawwlak_demo1');

/** MySQL database username */
define('DB_USER', 'pawwlak_demo1');

/** MySQL database password */
define('DB_PASSWORD', '*******');

/** MySQL hostname */
define('DB_HOST', 'localhost');

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8mb4');

/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');


/**#@+
 * Authentication Unique Keys and Salts.
 *
 * Change these to different unique phrases!
 * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
 * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
 *
 * @since 2.6.0
 */
define('AUTH_KEY',         '2zYYuJ)vQk.)[u9YZN|?nH$%,upKR.|M9LU~Ia?U<xR%_Nkjm-Y(0qCc2+>s[4~f');
define('SECURE_AUTH_KEY',  '*m0QP$nkR1p(DKM?mQvl5h`yI%8TcdNCE,S!Kdu9I6a~:&Wu/nXV?9pKW1n!&2xw');
define('LOGGED_IN_KEY',    'ekZe)AMW@r[rux$OB2WH<`B_l*+$[v8:^bNGqjps+kEF!|ENpm5gN<]8)p7cg7QE');
define('NONCE_KEY',        'dC1<i[BWhz*T#L(`8P`gz}J2/YA67?~Ps<0g G)@a1N_`Mx+nN^%MW4q)NU;.5/%');
define('AUTH_SALT',        'x.zML}$pIbtCGp-/A44kFZB[uLY~;0R9#I0]W~lc9DyLlKU`]HeUSk)$6/(75T}v');
define('SECURE_AUTH_SALT', 'dT`KJVh6|xjevK/3:#t3C?IcE0>q%} tFWkT-}I*H60wA|lf);Z1m9bV]G;*qwc/');
define('LOGGED_IN_SALT',   'GeDCcC$uR^6e(4(TjF94N$Yh<QIpt_?^q.Ixy{LBW=eez&Ql_7/CqS1r+R;uP+31');
define('NONCE_SALT',       'DO.kU/6]s<k<+kfbE`EWf$:f>5G%Q9WPGjE?^0AS3,&OcLfGnY6pgd.orwdq`~C(');

/**#@-*/

/**
 * WordPress Database Table prefix.
 *
 * You can have multiple installations in one database if you give each
 * a unique prefix. Only numbers, letters, and underscores please!
 */
$table_prefix  = 'wp_';

/**
 * For developers: WordPress debugging mode.
 *
 * Change this to true to enable the display of notices during development.
 * It is strongly recommended that plugin and theme developers use WP_DEBUG
 * in their development environments.
 *
 * For information on other constants that can be used for debugging,
 * visit the Codex.
 *
 * @link https://codex.wordpress.org/Debugging_in_WordPress
 */
define('WP_DEBUG', false);

/* That's all, stop editing! Happy blogging. */

/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
    define('ABSPATH', dirname(__FILE__) . '/');

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');

Do you know why it dosen't work?

解决方案

You defined the wrong constants. The top of your wp-config.php file should be:

define('HOME','http://demo1.make4u.pl');
define('SITEURL','http://demo1.make4u.pl');

Note that WP_HOME became HOME and WP_SITEURL became SITEURL.

Alternatively, if this does not work for you, try connecting to the database, navigate to the wp_options table, and adjust the entries for home and siteurl to your new URL's.

If you are confident in using SQL queries on your database, you can make use if yuyokk's code as a SQL Query which will do a comprehensive find/replace in your database:

REMEMBER: Backup your database before attempting any SQL Queries!

UPDATE wp_options
SET option_value = 'http://demo1.make4u.pl'
WHERE option_name = 'home';

UPDATE wp_options
SET option_value = 'http://demo1.make4u.pl'
WHERE option_name = 'siteurl';

UPDATE wp_posts
SET post_content = REPLACE(post_content,'http://fryzjer.make4u.pl','http://demo1.make4u.pl');

UPDATE wp_posts
SET guid = REPLACE(guid,'http://fryzjer.make4u.pl','http://demo1.make4u.pl');

这篇关于更改站点 URL 不起作用 Wordpress的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆