-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Route redirection not working #3041
Comments
This problem is because |
@Instrye thx for your answer :) but it not true. That route is already defined and if I change it to route name everything works. I think that redirect should work even that URI is not defined - you don't think so? We could have a situation that redirection to not existed URI redirect it to the next URI. |
It's more complicated :) It looks like redirection doesn't work for addresses with / eg Now the redirection works
Now the redirection does not work:
|
I just use Regarding your second question, I think you are right, I have made a change |
This problem is because
I think this is the correct order |
You're right. After changing the routes order is a bit better but still, there are few bugs(?):
or I am still doing something a wrong way? |
I think, These problems already processed |
Ok, I tested your code from PR and:
|
So, Second Parameter is URI OR named, Class::name not support Another problem is not what I am good at, But code annotate seems to give a reason, You can see : https://en.wikipedia.org/wiki/Post/Redirect/Get |
I know that
That problem is only when the URI is the same as the route name
Yes, I saw that. But I not able to create a |
You first problem I can't recurrent.
Location: http://example.com/register
Location: http://localhost/login |
@Instrye forgive me, I gave you wrong code :/ There should be a
or
We are redirected to location |
The problem because custom router replace. Router must be only. |
Sorry, but I don't understand. Can you explain what you mean? |
First, you set |
@Instrye is right. It seems to me like everything is sorted out already. If not, please feel free to open a new issue. |
Describe the bug
After using
I get an error
but if the second param I set as named route then everything is working properly. The problem exists only when the second param is a URI
CodeIgniter 4 version
4.0.2
Affected module(s)
I not sure but here I found some changes for this line https://github.com/codeigniter4/CodeIgniter4/pull/2481/files#diff-d2374d65fd714c18dbee9f5adaa8dd6cL488
Expected behavior, and steps to reproduce if appropriate
Redirection working properly for the second param as a URI .
Context
The text was updated successfully, but these errors were encountered: