So this may sound weird, however I currently have mod_rewrite set-up to pass 2 variables through.
RewriteRule ^profiel/(.*)$ index.php?p=profiel&user=$1
In the second var (&user=), it passes a username which is retrieved through GET in PHP. However, some of the usernames can have question marks in them. However if this is the case, the question mark won't be passed to the GET variable. (For example: "www.example.com/profiel/whoami?" ends up as just "whoami" instead of "whoami?")
I honestly don't know how to solve this problem. Any help would be great!
You can use the PHP function
urlencode
to encode the username. For example,whoami?
will becomewhoami%3F
. So your url will becomewww.example.com/profiel/whoami%3F
Then to retrieve your username, you can use
urldecode
.Here's the documentation on both function:
You can use this rule by capturing your values directly from
THE_REQUEST
variable: