Jump to content

Temporary redirect all /en/ urls without deactivating?


Masiorama

Recommended Posts

Hello there, in my shop there are 2 languages.

I want to temporary deactivate one language (/en) since the translations are not ready (and I guess it will take weeks) but if I do that from the panel the remaining language has its url changed (from /it to /) which is bad.

Can I temporary hide the /en version of the site with a simple htaccess rewrite, and then remove the rule once the translations are ready?

Something like this should work?

RewriteEngine on
RewriteCond %{REQUEST_URI} en/
RewriteRule .* https://www.website.com/it/ [R=301,L,NC]
# the following are just the rest of my custom rewrites section, which do work ...
RewriteCond %{HTTPS} !on
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Because it doesn't.

I tried also with simpler 

RewriteRule ^/en/ /it/ [L,R=301]

Maybe they are both technically wrong, I'm not that good with apache, but I guess that something else has priority here.

Any hint or workaround?

Thanks in advance.

Link to comment
Share on other sites

On 12/18/2019 at 11:01 PM, El Patron said:

could you not just simply disable the language in the back office?  Then it cannot be accessed.

Nope, since having just only one more language, the url would be all rewritten to / from /xx, and this is bad for SEO.

@Bill Dalton I did something like you suggested, plus forced in the panel to use my primary language without checking the language browser (International -> Localization).

Thanks guys.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...