Modify login url to site.com/login?redir=feature/9%2B1/abc
. That should do the trick.
PHP Redirect without encoding URL
-
26-06-2022 - |
Question
I have a codeigniter app that has an authentication system. Sometimes a user will get logged out and they will get forwarded to site.com/login?redir=feature/9+1/abc
. Upon logging in they should get forwarded to site.com/feature/9+1/abc
The problem arises when the user is forwarded: the +
in the URL is changed to %20
. %
is a disallowed URL character so my users sees an error message saying an invalid character is in the URL. Even if I add %
to the list of allowed characters site.com/feature/9%201/abc
is not the same as site.com/feature/9+1/abc
and the user sees a 404 error.
Is there there a way I can forward users using PHP to /feature/9+1/abc
instead of /feature/9%201/abc
?
Solution
OTHER TIPS
it may be useful for you as it worked for me
try urlencode function http://php.net/manual/en/function.urlencode.php in the time of sending and to fetch use urldecode function