ad域 父域 管理 子域

Do you want to move a WordPress site from subdomain to root domain? The process is fairly easy to follow, and there is a way to save your SEO rankings as well. In this article, we will show you how to easily move WordPress from subdomain to root domain with step by step instructions.

您是否要将WordPress网站从子域移动到根域? 该过程相当容易遵循,并且还有一种方法可以保存您的SEO排名。 在本文中,我们将向您展示如何通过分步说明轻松地将WordPress从子域移动到根域。

将WordPress从子域转移到根域 (Transferring WordPress from Subdomain to Root Domain)

A subdomain is an extension of your root domain name. For example, http://yourwebsite.example.com is a subdomain of example.com. In this case, example.com is the root domain.

子域是您的根域名的扩展。 例如,http://yourwebsite.example.com是example.com的子域。 在这种情况下,example.com是根域。

Search engines consider subdomain to be a totally different website. This is why you need to make sure that you properly redirect search engines to the root domain after the transfer. This will help you preserve search rankings after moving your website.

搜索引擎认为子域是一个完全不同的网站。 这就是为什么您需要确保在转移后将搜索引擎正确重定向到根域。 这将帮助您在移动网站后保留搜索排名。

Unlike moving a WordPress site to new host or a new domain name, moving a site to root domain is a bit easier.

与将WordPress网站移至新主机或新域名不同 ,将网站移至根域要容易一些。

Primarily because both are usually hosted with the same web hosting company. This allows you to skip a few steps.

主要是因为两者通常都由同一网络托管公司托管。 这使您可以跳过一些步骤。

Let’s take a look at how to move a WordPress site from subdomain to root domain.

让我们看一下如何将WordPress网站从子域移动到根域。

步骤1.创建网站的完整备份 (Step 1. Create a Complete Backup of Your Website)

You should always keep a backup solution installed on your website for automated backups. There are plenty of WordPress backup plugins that you can use to keep your WordPress content safe.

您应该始终在网站上安装备份解决方案以进行自动备份。 您可以使用许多WordPress备份插件来确保WordPress内容的安全。

Now if you already have a backup plugin installed, then you may be thinking that you can skip this step.

现在,如果您已经安装了备份插件,那么您可能会认为可以跳过此步骤。

This step is to remind you that even if you have automated backups of your website, you still need to create a complete backup of your site. This includes a database backup as well as a backup of all your WordPress files and folders.

此步骤旨在提醒您,即使您具有网站的自动备份,您仍然需要创建网站的完整备份 。 这包括数据库备份以及所有WordPress文件和文件夹的备份。

Once you have created a complete backup, make sure that you store it on a remote location or on your computer.

创建完整的备份后,请确保将其存储在远程位置或计算机上。

步骤2.将WordPress文件从子域移动到根文件夹 (Step 2. Moving Your WordPress Files From Subdomain to Root Folder)

First you need to connect to your website using a FTP client or cPanel’s file manager. Once connected, go to your subfolder location and download all your WordPress files to your computer.

首先,您需要使用FTP客户端或cPanel的文件管理器连接到您的网站。 连接后,转到子文件夹位置,然后将所有WordPress文件下载到计算机上。

Next, open the public_html folder of your root domain. Depending on how your WordPress hosting environment is setup, this folder could also be named www or after your domain name.

接下来,打开您的根域的public_html文件夹。 根据您的WordPress托管环境的设置方式,此文件夹也可以命名为www或以您的域名命名。

Now, you need to upload all WordPress files you downloaded earlier to the root directory.

现在,您需要将之前下载的所有WordPress文件上传到根目录。

步骤3.更改WordPress URL和站点URL设置 (Step 3. Change WordPress URL and Site URL Settings)

Once you move the WordPress files, you will not be able to access the WordPress admin area on the root domain. Trying to login to the root website will send you back to the subdomain website’s admin area.

移动WordPress文件后,您将无法访问根域上的WordPress管理区域。 尝试登录到根网站将使您返回到子域网站的管理区域。

To fix this, switch to the FTP client and go to the root directory of your domain name. Next, you need to edit the wp-config.php file and add the following lines just before the line ‘That’s all, stop editing! Happy blogging’.

要解决此问题,请切换到FTP客户端,然后转到域名的根目录。 接下来,您需要编辑wp-config.php文件,并在“就此停止编辑! 祝您博客愉快”。


define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

Don’t forget to replace example.com with your own domain name. If you want your root website to use www then you will need to enter the URLs with www prefix.

不要忘记用您自己的域名替换example.com。 如果您希望根网站使用www,则需要输入带有www前缀的URL。

Save your changes and upload the wp-config.php file back to your website.

保存您的更改,并将wp-config.php文件上传回您的网站。

You can now visit your WordPress site’s admin area on the root domain name.

您现在可以在根域名上访问WordPress网站的管理区域。

步骤4.更新URL (Step 4. Update URLs)

Your WordPress site has moved to the root domain, but there will be links inside your WordPress database pointing to the subdomain.

您的WordPress网站已移至根域,但WordPress数据库中将有指向子域的链接。

Let’s fix that.

让我们修复它。

You will need to install and activate the Velvet Blues Update URLs plugin. For more details, see our step by step guide on how to install a WordPress plugin.

您将需要安装并激活Velvet Blues Update URLs插件。 有关更多详细信息,请参阅有关如何安装WordPress插件的分步指南。

Upon activation, you need to visit Tools » Update URLs page.

激活后,您需要访问工具»更新URL页面。

On this page, you need to enter your subdomain url next to the Old URL option and add your root domain as the new URL. Next, under the ‘Choose which URLs should be updated’ area, you need to check all options except ‘All GUIDs’.

在此页面上,您需要在“旧UR​​L”选项旁边输入您的子域URL,并将您的根域添加为新URL。 接下来,在“选择应更新的URL”区域下,您需要检查除“所有GUID”以外的所有选项。

Once you are done, click on the ‘Update URLs Now’ button to continue.

完成后,单击“立即更新URL”按钮以继续。

The plugin will now update all URLs in your WordPress database. This may take some time. Once finished, you will see a success message.

现在,该插件将更新WordPress数据库中的所有URL。 这可能要花点时间。 完成后,您将看到一条成功消息。

步骤5.将所有子域流量重定向到根域 (Step 5. Redirect All Subdomain Traffic to The Root Domain)

Now that you have moved WordPress files, let’s make sure that your subdomain traffic is redirected to the root domain name.

现在您已经移动了WordPress文件,让我们确保您的子域访问量已重定向到根域名。

Go to your subdomain folder and make sure that hidden files are forced to be visible.

转到您的子域文件夹,并确保隐藏文件被强制可见。

Your FTP client settings have an option to always show hidden files. In FileZilla, it is located under ‘Server > Force Showing Hidden Files’ option.

您的FTP客户端设置具有始终显示隐藏文件的选项。 在FileZilla中,它位于“服务器>强制显示隐藏文件”选项下。

If you are using cPanel File Manager, then click on the Settings button at the top right corner of the screen. This will bring up the preferences popup. You need to select ‘Show hidden files’ and then click on the save button.

如果您使用的是cPanel File Manager,则单击屏幕右上角的“设置”按钮。 这将弹出首选项弹出窗口。 您需要选择“显示隐藏文件”,然后单击“保存”按钮。

If your subdomain folder already has a .htaccess file, then you can delete it and create a new one. Inside the new .htaccess file, you need to copy and paste the following code:

如果您的子域文件夹已经具有.htaccess文件 ,则可以将其删除并创建一个新文件。 在新的.htaccess文件中,您需要复制并粘贴以下代码:


<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^yoursubdomain\.example\.com$ [NC]
RewriteRule ^(.*)$ "http://example.com/$1" [R=301,L]
</IfModule>

Don’t forget to replace yoursubdomain with your actual subdomain, and example.com with your domain name.

不要忘记用实际的子域名替换yoursubdomain,用域名替换example.com。

Please note that the RewriteRule line uses a non-www URL. If you want to use www in your root domain, then you will need to add your URL with a www prefix.

请注意,RewriteRule行使用非www URL 。 如果要在根域中使用www,则需要添加带有www前缀的URL。

Save your changes and upload your .htaccess file to the server.

保存更改,然后将.htaccess文件上载到服务器。

That’s all, you have successfully moved your site from subdomain to root domain. You can now visit your website to see it in action. Test out your website to make sure that everything is working fine.

就是这样,您已经成功将站点从子域移到了根域。 现在,您可以访问您的网站以查看其运行情况。 测试您的网站,以确保一切正常。

We hope this article helped you move your site from subdomain to root domain. You may also want to see our ultimate WordPress SEO guide for beginners.

我们希望本文能帮助您将网站从子域移到根域。 您可能还希望查看针对初学者的终极WordPress SEO指南 。

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

如果您喜欢这篇文章,请订阅我们的YouTube频道 WordPress视频教程。 您也可以在Twitter和Facebook上找到我们。

翻译自: https://www.wpbeginner.com/wp-tutorials/how-to-properly-move-wordpress-from-subdomain-to-root-domain/

ad域 父域 管理 子域

ad域 父域 管理 子域_如何正确地将WordPress从子域移动到根域相关推荐

  1. AD域用户批量修改密码_大公司如何对企业AD域进行管理?

    AD域管理一直是企业IT管理员的重要工作之一,但随着目前国内企业发展的速度来看,越来越多企业在国内近几年经济环境的带动下越发壮大.企业壮大随之而来的自然是人员的扩充,因此AD域管理对IT管理员将是份巨 ...

  2. 渗透测试之子域到父域的横向移动(Sid History)

    前言 本文接上篇文章探究子域如何横向移动到父域的Enterprise Admin组,并给出防御方法. Enterprise Admins组 在父子域中,最重要的莫过于Enterprise Admins ...

  3. Windows server服务篇1:Windows Server 2012R2 AD域控 辅助域 只读域 子域

    Windows Server 2012R2 域与活动目录介绍 域与活动目录 什么是域 域(Domain)是Windows网络中独立运行的单位,域之间相互访问则需要建立信任关系(Trust Relati ...

  4. 在父域的基础上,添加子域

    父域--Window server 2016 子域--window server 2016 父域(提前创建好的)-- 子域的创建 打开服务器管理器,添加角色和功能向导 安装域服务 首先要确保两台虚拟机 ...

  5. 父域与子域之的信任关系

    搭了一个测试环境,做一个父.子域间信任关系的测试,过程如下: 两台测试服务器,主域为primary.com,子域为child.primary.com 客户机Clientpri加入父域,客户机Clien ...

  6. 前端把cookie写在父域里_单点登录的三种实现方式

    前言 在 B/S 系统中,登录功能通常都是基于 Cookie 来实现的.当用户登录成功后,一般会将登录状态记录到 Session 中,或者是给用户签发一个 Token,无论哪一种方式,都需要在客户端保 ...

  7. 子域转发父域(DNS)

    请参考配置子域授权 问题 继续进行本次操作,与向父DNS查询子域记录相反,本案例要求进一步实现当客户机向子DNS查询父域中域名www.asd.cn的时候也能获得正确结果. 需要完成的配置任务如下: 1 ...

  8. 什么是主域、子域_什么是子域?

    什么是主域.子域 Subdomain is a term used in the internet area in order to describe the children of a domain ...

  9. 【域控管理】父域的搭建

    从这篇博文开始,所有的域控系统都是在虚拟机中创建的. 在VM里安装Windows Server 2008 R2的方法就不多说了,无脑式安装,略过不提. 进到系统桌面,打开本地连接,设置网卡的IP地址, ...

最新文章

  1. ADAS感知算法观察
  2. C++智能指针: shared_ptr 实现详解
  3. 批处理-取年月日、时分秒毫秒
  4. 利用vs.net快速开发windows服务(总结)
  5. mysql c contor_Python之那些好玩的图画
  6. ubuntu添加dvd光盘源
  7. ppt android sdk,《0.AndroidSDK概述.ppt
  8. php算法在线刷题,c,算法_每日一道算法:leetcode 刷题碰到的问题。,c,算法 - phpStudy...
  9. Netty Reactor线程模型与EventLoop详解
  10. jQuery子页面刷新父页面--局部刷新+整体刷新 [转]
  11. 计算机的试题步骤,计算机二级题目  做计算机二级试题,按照答案步骤,为什么word 爱问知识人...
  12. 【考研英语5500词】 —思维导图,建议收藏(四六级党也可入手)!!!
  13. 解析activity之间数据传递方法的详解
  14. 该更新一下你的密码字典了
  15. python爬取上海链家网二手房数据
  16. 用python画太阳花过程_有几个问题一直弄不出来求大神 python(python太阳花教程)
  17. Q-routing发展以及原始实验复现
  18. 快速选取单元格的10种方法。
  19. mysql 大量写入 优化_MYSQL大批量写入之性能优化
  20. 绝地求生 服务器无响应,绝地求生卡在登陆页面怎么办

热门文章

  1. 2022 最新 Android 基础教程,从开发入门到项目实战【b站动脑学院】学习笔记——第六章:数据存储
  2. Wordcloud库的安装
  3. OpenCV3编程入门读书笔记4-形态学滤波
  4. python开发程序知道微信好友是否已读信息吗_用Python来检测微信好友是否拉黑你...
  5. 【IoT】创业指南:如何理解需求管理过程?这篇文章就够了
  6. 京东店铺运营收益最大化方法技巧
  7. php cgi远程控制,php cgi远程任意代码执行漏洞
  8. 类SCP程序(无身份认证)
  9. html5 dash,使用 DASH.js 在 HTML5 应用程序中嵌入 MPEG-DASH 自适应流式处理视频
  10. 轻量级网络之mobilenet_v1详解