How to write rewriterule for Cyrillic?

In Latin everything works:
RewriteRule ^text/([a-zA-Z]+)/?$ /app/text/detail.php?t=$1

Tried to substitute AAA-YAYA - did not help, or rather works only with the first letter after the slash (e.g., /text/and).
March 23rd 20 at 19:44
1 answer
March 23rd 20 at 19:46
Solution
\p{Cyrillic} https://www.php.net/manual/ru/regexp.reference.uni...
And if you need not only the Cyrillic, \p{L}.

RewriteRule (*UTF8)^text/(\p{L}+)/?$ /app/text/detail.php?t=$1 [L]


If you use [a-AeA-JAJA], then the file must be saved in UTF-8 without BOM.
RewriteRule (*UTF8)^text/([a-AeA-JAJA]+)/?$ /app/text/detail.php?t=$1 [L]


Another option.
RewriteRule ^text/((?:\xd0[\x81\x90-\xbf]|\xd1[\x80-\x91])+)/?$ /app/text/detail.php?t=$1 [L]
The file is saved without BOM, ordered so:
RewriteRule ^text/([a-AeA-JAJA]+)/?$ /app/text/detail.php?t=$1

Does not work(
More precisely, it works, but only by the first letter of the word, example:
1. /text/b - works
2. /text/be - no longer works
--
If prescribed after rewriterule (*UTF8) is not working. - Sophia56 commented on March 23rd 20 at 19:49
@Sophia56, and if you try
RewriteRule ^text/([^/]+)/?$ /app/text/detail.php?t=$1 [L]
- verona_Balistreri commented on March 23rd 20 at 19:52
@verona_Balistreri, this code works but opens a new problem - open any url (I have only Russian characters).
Write that Russian characters can't handle with the exception of the mask, any character.
While thus decided the issue:
RewriteRule ^text/([абвгдеежзийклмнопрстуфхцчшщьыъэюяабвгдеежзийклмнопрстуфхцчшщьыъэюя]+)?$ /app/text/detail.php?t=$1 [L]

How to write all of this in short, I'll never know, and if at all possible - Sophia56 commented on March 23rd 20 at 19:55
@Sophia56, the website page in UTF-8 or some other?
And what version of Apache. - verona_Balistreri commented on March 23rd 20 at 19:58
@verona_Balistreri, all pages in utf-8 without BOM.
The apache version - Apache/2.2.15 (CentOS) - Sophia56 commented on March 23rd 20 at 20:01
@Sophia56,
RewriteRule ^text/((?:\xd0[\x81\x90-\xbf]|\xd1[\x80-\x91])+)/?$ /app/text/detail.php?t=$1 [L]
- verona_Balistreri commented on March 23rd 20 at 20:04
@verona_Balistreri, what you need! Very grateful to You! - Sophia56 commented on March 23rd 20 at 20:07

Find more questions by tags htaccess