Skip to content
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

redirect to route ignore baseurl #1126

Closed
puschie286 opened this issue Aug 1, 2018 · 2 comments
Closed

redirect to route ignore baseurl #1126

puschie286 opened this issue Aug 1, 2018 · 2 comments

Comments

@puschie286
Copy link
Contributor

puschie286 commented Aug 1, 2018

there are some redirection problems ( well it only works with absolute paths for me )

e.g redirect()->route( 'ROUTE', [], 302 ) will route to HOST/ROUTE instead of HOST/BaseURL/ROUTE
response->redirect( '/ROUTE' ) have the same result

public $baseURL = 'https://*******/WorkDirectory/PHPPlayground/CodeIgniter4/public/';

reproduce:

  1. create a page with multiple uri parts route ( e.g. BaseURL/Test/Redirect/Route )
  2. this page redirect to another route ( e.g $this->response->redirect( 'Home' )
  3. you will get an two Location headers in the response with Location: /Home
  • you will be redirected to https://*******/Home instead of https://*******/WorkDirectory/PHPPlayground/CodeIgniter4/public/Home
@puschie286
Copy link
Contributor Author

currently i use $this->setHeader('Location', config( App::class )->baseURL.ltrim( $uri, '\\' ) ); as a temporary fix

@puschie286
Copy link
Contributor Author

fixed by #1147

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants