I want to whenever user types in address bar uri which isn't mapped in my pretty-config.xml file to get 404 error. My pretty-config looks like:
<?xml version="1.0" encoding="UTF-8"?>
<pretty-config xmlns="http://ocpsoft.org/schema/rewrite-config-prettyfaces"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ocpsoft.org/schema/rewrite-config-prettyfaces>
<url-mapping id="landing">
<pattern value="/" />
<view-id value="/faces/index.xhtml" />
</url-mapping>
<url-mapping id="login">
<pattern value="/login" />
<view-id value="/faces/login.xhtml" />
</url-mapping>
</pretty-config>
For example when user types myapp.com/faces/login.xhtml application should return 404 error. How to do that?
I'd recommend using Rewrite (https://www.ocpsoft.org/rewrite) for this. It's already included in your project with PrettyFaces: