Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

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

share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.