0

We have a website and a website with Arabic and English addresses. We need to redirect some URLs with a 404 status code to a 410 status code in the NGINX web service (due to SEO). We configured the NGINX web service and added Arabic and English URLs, English URLs successfully redirect to status code 410 (NGINX error page), but the redirection of Arabic URLs does not work and gives users a 404 error page The final show. My question is why redirecting Arabic URLs doesn't work, since the configuration of the two types of URLs (Arabic and English) is exactly the same.

Example URLs: https://example.com/test And https://example.com/تست

NGINX configuration file:

map $request_uri $is_retired_url {
      including /etc/nginx/conf.d/redirects/410.redirects;
}

server {
           if ($is_retired_url) {
        return 410;
           }

Contents of file 410.redirects:


/test 1;
/تست 1;

Also, I encoded Arabic URLs with https://www.urlencoder.org/, but it doesn't work.

NGINX configuration reference: https://jonathanmh.com/nginx-410-maps-and-custom-error-page/

  • Your `410.redirects` file seems to be wrong. The Arabic entry has `/1` where the URL should be and Arabic text where the `1` should be. – Richard Smith Sep 01 '23 at 09:12

0 Answers0