I want to redirect and then rewrite my URL (internal forwarding) so that it doesn't show the php extension as well it doesn't show the ?, = and & in the URL.
This is the example of what I want to achieve, my actual URL passed to header is http://localhost/portal/error.php?error=runtime-error
which I want to show in the address bar http://localhost/portal/error.php/error/runtime-error
and internally this URL is forwarded to the actual URL http://localhost/portal/error.php?error=runtime-error
Also, what I want to achieve is here is single redirect and single rewrite rule(for internal forwarding) which applies to all the scripts instead of adding individual redirect and rewrite rules for each script page.
Below is the code that is present in my .htaccess file.
ErrorDocument 404 /portal/error.php
ErrorDocument 500 /portal/error.php
RewriteRule ^include/(.*)$ /portal/error.php [L,R=404]
Kindly let me know if any more information is required.
Thanks in advance