问题
I have a weird problem going on. I have my main site (mesopinions.ca), it's a wordpress installation. I also have a couple of subdomains, with their own wordpress installation (no multisite). It's working great with concours.mesopinions.ca subfolder, but with this new one it's not working : partymom.mesopinions.ca
I can reach it, it's fine. But after some seconds (after some page loads), bam, I get the main site (mesopinions.ca) instead of that subdomain (the url is still good in the address bar, but the screen is showing the other site).
Tried clearing the cache, multiple browsers/pcs, reinstalling wordpress, changing the subdomain to another subfolder and also testing some other wordpress themes. Htaccess file also been reseted to the wordpress default. Still doing it.
As anyone ever had this ? I'm frustrated since I cannot find the answer to this.
回答1:
Make sure your HT ACCESS file contain this code.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /site/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /site/index.php [L]
</IfModule>
# END WordPress
And if still have same problem then check your database WP_OPTION table and change the path as per your URL.
回答2:
Seems like the htaccess from another subdirectory is causing this. Not sure why, because it should not even access it. I removed the htaccess file and it seems better.
来源:https://stackoverflow.com/questions/6393393/wordpress-subfolder-installation-redirecting-to-root