简体   繁体   English

修复重定向到主域的子域

[英]fix subdomain that redirect to the main domain

I encountered a problem after I moved the site to new subdomain,将站点移至新子域后遇到问题,

Every time I enter to my website, I am directed to the subdomain.每次我进入我的网站时,我都会被定向到子域。 I think its htaccess issues.我认为它的 htaccess 问题。

I have 2 website, one in the domain and the other in subdomain (previously was in main domain)我有 2 个网站,一个在域中,另一个在子域中(以前在主域中)

(subdomain directory: public_html/store) | (子域目录:public_html/store)| (domain directory: public_html) (域目录:public_html)

subdomain htaccess file:子域 htaccess 文件:

    <IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

Have a read of this article: https://wordpress.org/support/article/changing-the-site-url/阅读这篇文章: https://wordpress.org/support/article/changeing-the-site-url/

Additionally, you can access your wp_options table via phpmyadmin, and update siteurl and home to the new address.此外,您可以通过 phpmyadmin 访问您的wp_options表,并将siteurlhome更新为新地址。

Check the corresponding database's siteurl and home values as those might both have the subdomain address in them;检查相应数据库的 siteurl 和 home 值,因为它们可能都包含子域地址; replace them with the desired domain name, save and see if that doesn't fix the issue.将它们替换为所需的域名,保存并查看是否不能解决问题。

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

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