Title: Doubt on redirection
Last modified: March 15, 2024

---

# Doubt on redirection

 *  Resolved [Tony Franco](https://wordpress.org/support/users/tony-franco/)
 * (@tony-franco)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/doubt-on-redirection/)
 * Hi!
 * Please, i need to make a lot of redirections at nginx.
 * For this moment website has several languages, for example in english:
 * domain.com/?lang=en or domain.com/post/?lang=en
 * I would like to make the proper redirection to:
 * domain.com/en/ or domain.com/en/post/
 * because it is more seo friendly…
 * Is it possible with plugin automatically all website? Or a block at nginx conf?
 * Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/doubt-on-redirection/#post-17502394)
 * It sounds like you can use a regular expression:
 * [https://redirection.me/support/redirect-regular-expressions/](https://redirection.me/support/redirect-regular-expressions/)
 *  Thread Starter [Tony Franco](https://wordpress.org/support/users/tony-franco/)
 * (@tony-franco)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/doubt-on-redirection/#post-17503419)
 * Hi [@johnny5](https://wordpress.org/support/users/johnny5/)!
 * Thank you by your return!
 * I have a difficult with this, tried several times but with no success…
 * Last tried:
 *     ```wp-block-code
       server {
           ...
           if ($arg_lang = "en") {
               return 301 $scheme://$host/en$request_uri;
           }
           if ($arg_lang = "es") {
               return 301 $scheme://$host/es$request_uri;
           }
   
           location / {
               if ($args ~* "lang=en") {
                   rewrite ^/(.*)/$ /en/$1? permanent;
               }
           }
   
           location / {
               if ($args ~* "lang=es") {
                   rewrite ^/(.*)/$ /es/$1? permanent;
               }
           }
   
           ...
       }
       ```
   
 * Could you help me?
 * Thanks and Regards,
 * Tony
 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/doubt-on-redirection/#post-17503466)
 * I can only help with Redirection itself and the details are on the support page
   I referenced.
 *  Thread Starter [Tony Franco](https://wordpress.org/support/users/tony-franco/)
 * (@tony-franco)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/doubt-on-redirection/#post-17503473)
 * ok thanks!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Doubt on redirection’ is closed to new replies.

 * ![](https://ps.w.org/redirection/assets/icon-256x256.jpg?rev=983639)
 * [Redirection](https://wordpress.org/plugins/redirection/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/redirection/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/redirection/)
 * [Active Topics](https://wordpress.org/support/plugin/redirection/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/redirection/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/redirection/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Tony Franco](https://wordpress.org/support/users/tony-franco/)
 * Last activity: [2 years, 2 months ago](https://wordpress.org/support/topic/doubt-on-redirection/#post-17503473)
 * Status: resolved