Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wordpress subfolder installation redirecting to root

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.

like image 261
Francois Avatar asked Oct 18 '25 15:10

Francois


2 Answers

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.

like image 63
Shobhit Chugh Avatar answered Oct 21 '25 22:10

Shobhit Chugh


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.

like image 43
Francois Avatar answered Oct 21 '25 21:10

Francois