I have the following rule that was created by another programmer and that is working in some processes:
RewriteRule ^chk-error/(.*) chk_err.php?error=$1 [L]
It retrieves everything that comes after chk-error/
and puts it inside error
to be treated inside the chk_err.php
file. It works normally.
But I will need to use the same page chk_err.php
and the URL that will access this path will come with a question mark. So:
https://www.example.com/chk-error/?errcat=5&errcd=514&id=12&in=gt5
I would like to adapt so that she can recover everything that comes after the interrogation "?". Without breaking the previous process.
What would be the new RewriteRule with the "?" being optional?
In summary I wanted to rewrite the RewriteRule that is working to retrieve this URL:
https://www.example.com/chk-error/errcat=5&errcd=514&id=12&in=gt5
In order to retrieve this other URL pattern:
https://www.example.com/chk-error/?errcat=5&errcd=514&id=12&in=gt5
Note that the difference between them is only the question mark "?" after chk-error/
.