Redirect by language

 know languages ​​"title =" saber idiomas "width =" 500 "height =" 348 "class =" aligncenter size-medium wp-image -5856 "srcset =" 500w, /saber-idiomas.jpeg 518w "sizes =" (max-width: 500px) 100vw, 500px "/> </a></p>
<p> Every time, in this globalized world, it is more frequent to find sites created in several languages, aimed at users of In my case I offer this functionality through a plugin, which generates the content of <a href= WordPress Help in various languages ​​in a structure of subfolders of type ' 'where ' language ' is the language code (eg: in for English, pt for Portuguese, and so on.

Well what would you think to redirect your readers directly to the version in your language of your website? . Well it is very simple, you do not have to install any plugin or modify your template, just have a folder structure for the different languages ​​in which your site is displayed. It is not even an exclusive WordPress trick

How do you get it with the redirection by language that you can add to your file '. Htaccess' and it's very easy. And this works because the browser of your readers always sends information to the server that visits, and one of these information is the language.

Just add a few lines like the following to your file '. Htaccess' ]:

In this example, in line 3 we say which language of the reader is redirected ( (en) ), and in the line 4 we note the route to which it will be redirected. You just have to adapt it to your needs.

Of course, you can add as many RewriteCond and RewriteRule as you need.

NOTICE : this publication is from two years ago or more. If it's a code or a plugin it might not work in the latest versions of WordPress, and if it's a news story it might be obsolete. Then do not say that we have not warned you.

Loading …

That may also help you:

How to ban by IP or domain from htaccess

I already discussed the issue of restrict access in depth a few months ago, but I thought it would be interesting to have this information in particular because there are more and more situations in which we need to avoid any visitor, or RSS feed thief, access our site created with WordPress.

Edit the file .htaccess and add these lines, modified according to your need, logically:

IP xx.xx is what you have to modify. You can also add as many lines deny from as you need.

Of course, as before, replace domain_a_banear with the domain in question and you can add as many lines of type RewriteCond% {HTTP_REFERER} domain_a_banear .com [NC] as needed.
 banned "title =" banned "width =" 500 "height =" 500 "class =" aligncenter size-full wp- image-5492 "srcset =" 500w, 150x150.jpg 150w "sizes =" (max-width: 500px) 100vw, 500px "/> </a> </p>
<p> And with these simple tricks you can get rid of undesirables, give them a few inches of your nose. tell it in the comments, we will all be grateful. </p>
	</div><!-- .entry-content -->

	<footer class= modeerPosted on Categories Avanzado, Banear, htaccess, IP, Programación, RewriteCond, RewriteEngine, RewriteRule, Seguridad, Tutoriales / Trucos, WordPress.orgLeave a comment on How to ban by IP or domain from htaccess