I want to use a custom page on 500 & 503 errorducument on IBM HTTP Server as well as shortener URL also using Rewrite that code for shorten URL (WCS).
Here are the rules I'm using:
RewriteCond %{REQUEST_URI} /en/store(.*)
RewriteRule ^/en/store(.*) $1 [R=301,L]
RewriteCond %{REQUEST_URI} /((?!wcsstore/)(?!search/)(?!cont/)(?!cons/)(?!cs/)(?!wcs/)(?!cache/)(?!webapp/)(?!swagger/)(?!solr/))(.*)
RewriteRule ^/((?!wcsstore/)(?!search/)(?!cont/)(?!cons/)(?!cs/)(?!wcs/)(?!cache/)(?!webapp/)(?!swagger/)(?!solr/))(.*) /webapp/wcs/stores/servlet/en/store/$2 [PT,L]
When I am not Using shorten URL code then ErrorDocument 500 /500.html Custom page is working fine. but when I am Using shorten URL code then ErrorDocument 500 /500.html Custom page is not working. And when I am using String like ErrorDocument 500 "Server in a problem so We will be back shortly" is working both condition, with shorten URL code or without shorten URL code.
Your final RewriteRule matches /500.html so it's rewritten. I'd suggest scrapping adding an additional RewriteCond that simply handles the error doc URL's, rather than adding more difficult to read negative lookaheads.
Note: the existing condition already looks redundant:
RewriteCond %{REQUEST_URI} /((?!wcsstore/)(?!search/)(?!cont/)(?!cons/)(?!cs/)(?!wcs/)(?!cache/)(?!webapp/)(?!swagger/)(?!solr/))(.*)
RewriteCond %{REQUET_URI} ^/\d\d\d.html
RewriteRule ^/((?!wcsstore/)(?!search/)(?!cont/)(?!cons/)(?!cs/)(?!wcs/)(?!cache/)(?!webapp/)(?!swagger/)(?!solr/))(.*) /webapp/wcs/stores/servlet/en/store/$2 [PT,L]