如何通过重写规则将 url 重定向到错误页面

How to redirect url into error page thorugh rewrite rule

This is my url

https://www.test.com/acheck/wcheck/logout

if i inject something between url like this https://www.test.com/acheck5.1/test1/wcheck/logout it is routing to valid page instead of error page.

in httpd.conf file i write rule like this but it's not working. can some guide on this

RewriteRule /acheck*/([A-Za-z0-9-])/logout https://www-test.com/acheck

but below one is working and routing to error page

RewriteRule /acheck5.1/test/wcheck/logout https://www-test.com/acheck

我们必须像下面提到的那样。

RewriteRule /acheck*/([A-Za-z0-9-]+)/注销https://www-test.com/acheck