Redirection of website-want to use /en folder being redirected to post

I encountered a strange behaviour with WordPress website.

I have created /en folder in the root and want to have another WordPress website there.

Read More

The problems appears when I try to open mainwebsite.com/en I’m being redirected to mainwebsite.com/english-post

So, WP gives the priority to the post that is found in the main domain and it’s slug begins with “en”.

I tried changing the folders name to “ren” and the website in the folder than shows up nicely.

I’ve checked .htaccess file for some redirects and none is set.

I noticed that this is a typical WP behaviour, as I tested on some “bigger” brands that use WP and same thing happens,ie:

https://www.smashingmagazine.com/en redirects to –> https://www.smashingmagazine.com/2014/11/enabling-multiscreen-tracking-with-google-analytics/

http://vanheusen.com/en redirects to –> http://vanheusen.com/products/english_shaded_box_silk_tie/

Have any idea how to solve this?

This is my .htaccess file:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(en/)
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Related posts

1 comment

  1. Try using this rule in your main .htaccess

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

    And then you need this rule below in the .htaccess inside en folder

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

    Let me know how this works

Comments are closed.