简体   繁体   English

Cpanel - 如何切换域?

[英]Cpanel - how to switch domains?

I need an help with cpanel, I have two domains: mywebsite.com and new.mywebsite.com , the last domain is the new wordpress project that is completed and I need to transfer to the old domain.我需要cpanel的帮助,我有两个域: mywebsite.comnew.mywebsite.com ,最后一个域是新的wordpress项目已经完成,我需要转移到旧域。 I have to switch the two projects by domain.我必须按域切换这两个项目。 The project in mywebsite.com needs to point to new.mywebsite.com and viceversa. mywebsite.com中的项目需要指向new.mywebsite.com ,反之亦然。 I'm using cpanel panel control but I can't find a way to do it.我正在使用 cpanel 面板控件,但我找不到方法来做到这一点。 Any suggestion?有什么建议吗?

You can change the document root to point to the other domain.您可以更改文档根目录以指向其他域。 To do this, go to cPanel -> File Manager -> the public_html folder of the domain you wish to switch from.为此,go 到 cPanel -> 文件管理器 -> 您要切换的域的 public_html 文件夹。 Open .htaccess file and add;打开.htaccess文件,添加;

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]     
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ./[DOMAIN YOU WANT TO 
SWITCH TO]/index.php [L]

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

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