Redirects with two wp installations
-
On my hosting platform I have two WP installations. One for the main domain (splendesco.nl) and one for a subdomain (zakelijk.splendesco.nl) in a subfolder. I had redirects set up in de root htaccess as follows
Redirect 301 /workshops /workshops-en-trainingen/
That was all working fine. After creating the subdomain however, the subdomain would also pick up the redirects, so I changed the code.
The complete htaccess in the root folder is now (I have numbered the redirect lines)
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On # custom redirects Options +FollowSymLinks -MultiViews # RewriteCond %{HTTP_HOST} !^www\.splendesco\.nl$ [NC] RewriteRule .? –[S=5] 1. > RewriteRule ^/workshop\-enneagram/(.*)$ /workshops\-en\-trainingen/workshop\-enneagram/$1 [R=301,NC,L] 2. > RewriteRule ^/workshop/(.*)$ /workshops\-en\-trainingen/$1 [R=301,NC,L] 3. > RewriteRule ^/workshops/(.*)$ /workshops\-en\-trainingen/$1 [R=301,NC,L] 4. > RewriteRule ^/training/(.*)$ /workshops\-en\-trainingen/$1 [R=301,NC,L] 5. > RewriteRule ^/trainingen/(.*)$ /workshops\-en\-trainingen/$1 [R=301,NC,L] # end of custom redirects RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress
This only partially works. Lines 1 and 3 work as expected. Lines 4 and 5 keep giving me a 404 and do not redirect. Line 2 does an incoreect redirect to https://www.splendesco.nl/workshops-en-trainingen/workshop-enneagram/.
I already tried the SEO redirect plugin. The redirects then works, but also the problem is back with them also being called from the subdomain.
So basically the questions is: if the above htaccess has problems, where are the problems, or: how would I set up redirects in such a way that they all work ONLY on the main domain and not on the subdomain.
Sorry for the long post. Thanks for your help.
John
- The topic ‘Redirects with two wp installations’ is closed to new replies.