문제

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?

도움이 되었습니까?

해결책

Modify login url to site.com/login?redir=feature/9%2B1/abc. That should do the trick.

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top