Home .htaccess redirect domain without language subfolder to language subfolder
Reply: 0

.htaccess redirect domain without language subfolder to language subfolder

user616
1#
user616 Published in June 19, 2018, 6:26 pm

I had got a domain like this "domain.com", now I create subfolders for languages. Now my domain has this subfolders "domain.it/it/" and "domain.com/en/". I need to redirect only the root domain "domain.it" to "domain.com/it/, I tried to do this in my .htaccess but it goes in "Too many redirect":

RewriteCond %{HTTP_HOST} ^(www\.)?domain.it$ [NC]
RewriteRule ^(.*) https://www.domain.it/it/ [R=301,L]

And this:

RewriteCond %{REQUEST_URI} !^/(en|it)/
RewriteRule ^(.*)$ https://www.domain.it/it/ [L,R=301]

How can I do that? Thanks

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.343331 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO