A
A
Anton Kulyavets2019-04-24 13:01:01
htaccess
Anton Kulyavets, 2019-04-24 13:01:01

Is it possible to create multiple 404 pages in different languages?

Is it possible to make multiple different 404 pages in different languages?
I note that different versions of the site are not on different subdomains, but in different folders, for example:
/ - ru version
/en/ - English
/ua/ -
Ukrainian en/404/ , and when on /ua/nevernaya-ssilka/ did it end up on /ua/404/ ?
I will add that now .htaccess looks like this:

AddDefaultCharset UTF-8
ErrorDocument 404 /404.php

RewriteEngine on

RewriteRule ^([^.?]+)$ %{REQUEST_URI}.php [L]

RewriteCond %{THE_REQUEST} "^[^ ]* .?.php[? ].$"

RewriteRule .* - [L,R=404]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2019-04-24
@SPEC1AL1ST

AddDefaultCharset UTF-8

RewriteEngine on

RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^([^.]+)$ $1.php [L]

RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{THE_REQUEST}      \.php
RewriteRule ^(en/|ua/|) $1404.php [L]

Files:
/404.php
/en/404.php
/ua/404.php
should set 404 response code with header or http-response-code

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question