简体   繁体   中英

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.

I have 2 website, one in the domain and the other in subdomain (previously was in main domain)

(subdomain directory: public_html/store) | (domain directory: public_html)

subdomain htaccess file:

    <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/

Additionally, you can access your wp_options table via phpmyadmin, and update siteurl and home to the new address.

Check the corresponding database's siteurl and home values as those might both have the subdomain address in them; replace them with the desired domain name, save and see if that doesn't fix the issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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