0

God, this little problem drives me crazy and I really hope that you'll help me how to figure it out.

I searched over all previous threads and in the codex of wordpress, I find some close situations but none of the answers solved my problems.

This is it : I've one host with a wordpress installed at the root. I've one domain pointing it. Everything is fine. I've need now a second install of wordpress, that i've installed in a subfolder. I've a second domain, linked to this subdfoler.

Like this :

  • root > domain.net
  • root/subfolder > anotherdomain.net

If I let the "site url" setting and the "wordpress url" setting with "domain.net/subfolder", this is OK, I can access to my second site and all permalinks work.

But if I edit my site url/wordpress url in "anotherdomain.net" it renders the "domain.net" homepage without style...

I'm sure this is a question of HTACCESS but I can't find how to properly write it...

Thanks for your answers !

(sorry for my english, not my mother tongue)

Here are .htaccess (at this state, I let them in order to access subfolder via domain.net/subfolder)

root:

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

root/subfolder

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

# END WordPress

I do not need a multisite, since the two installs are for two separate sites and users, who are just sharing same host.

  • Did you install the other site, after you have created the domain in your hosting and pointed it to the folder? If not, then you actually need to "move" the WP site in the folder to use the new domain and not the old. Re-writing the URL in the settings doesn't usually do a perfect job. Moving WP and Especially this – Firsh - LetsWP.io Mar 28 '15 at 15:03
0

In your subdirectory, open your access and change it to the stock setting.

root/subfolder:

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

# END WordPress

That should work.

0

All the config were good, the problem was with my host provider.

For the record, the htaccess for the site in the subfolder, when everything is ok :

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

And the site and wordpress urls pointing to the new domain.

0

If your second subfolder installation is successful, you may likely run into an issue when WordPress writes its Permalink (within the subfolder). The issue apparently has to do with the subfolder installation and how it sees the site root path. WordPress will normally write a .htaccess file in the installation directory, and that folder is usually the website root folder. Here is the applied solution:

change to new WordPress .htaccess (within the demo subfolder)

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /demo/
RewriteRule ^index.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /demo/index.php [L]
</IfModule>
# END WordPress

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.