Congratulations! You've managed to ask a question that has
not been asked seventeen lakh* times in the history of this forum. This will be fun.
First off: Would it be easier if you used the real names of all your paths and URLs instead of abc and def? It's perfectly permissible, so long as you stick with "example.com", and I think it might make things easier to sort out. It also means there's no risk of typos when you're editing from Real Name to Made-Up Name.
c) external users enter https://example.com/client/cef , it should redirect calls to application abc with context root (/abc-ui) hosed on EAP Cluster A
...
But the issue I am having is if user enters https://example.com/client/cef it is throwing 404 errors , and it works good when user enters https://example.com/client/cef/
I am struggling to add that trailing slash after cef
Do you mean that the intended redirect isn't taking place? Or that your clients get a 404 after the site has redirected them to the intended URL? And it only happens with this one of your four scenarios?
When you say "redirect" do you mean "rewrite"? In a situation like this, it's absolutely essential to get the terminology right, so we're not talking at cross purposes. Rewrite, as opposed to redirect, means that users enter
various-stuff
and then the site serves content from
various-other-stuff
while the user's address bar doesn't change. In which case, what's the [PT] even doing there? Wouldn't it be simpler to use the real filepaths if the user is none the wiser?
Is the difference between "external users" and "internal users" important to the rule? Or do you just mean that they go through different types of validation?
Let's try it again with the real names.
But first, just to make sure the RewriteEngine is working, try some nonsense rule like
RewriteRule foo http://example.com/bar.html [R=301,L]
and verify that the redirect takes place. It's not likely to be a mod_rewrite problem-- but it's the easiest thing to fix, so do double-check.
* Possibly seventeen crore. I lost count.