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

Bug: URL, Redirect and Pagination misbehave #2347

Closed
muradmustafayev opened this issue Oct 19, 2019 · 3 comments · Fixed by #2407
Closed

Bug: URL, Redirect and Pagination misbehave #2347

muradmustafayev opened this issue Oct 19, 2019 · 3 comments · Fixed by #2407
Assignees
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Milestone

Comments

@muradmustafayev
Copy link

I've similar problems as #2119 + some bonuses :)

I've deployed project to test.com/e and set baseURL from .env file. Issues are:

  • Redirect:
  1. redirect()->to('uri') function redirects to test.com/uri not test.com/e/uri
  2. redirect()->to('uri') at localhost(spark serve) duplicates url when tries to redirect. But at server works as expected but with issue N1. At localhost I'm using with trailing slash to bypass the issue ->to('/uri')
  • base_url misbehave:
  1. base_url('uri') -> test.com/e/uri.
  2. base_url('/uri') -> test.com/uri. Should be test.com/e/uri I guess
  3. base_url() . 'uri' -> test.com/e/uri (works but not a pretty solution)
  • Pagination: $pager->links() creates test.com/?page=2 instead of test.com/e?page=2
@jim-parry jim-parry changed the title URL, Redirect and Pagination misbehave Bug: URL, Redirect and Pagination misbehave Oct 19, 2019
@jim-parry jim-parry added the bug Verified issues on the current code behavior or pull requests that will fix them label Oct 19, 2019
@muradmustafayev
Copy link
Author

muradmustafayev commented Oct 20, 2019

After RC3 update:

  • Redirect:
  1. redirect()->to('uri') at localhost not duplicates URL but at server redirects to 'test.com' not 'test.com/e'
  • current_url() returns test.com/uri/1. Should be test.com/e/uri/1

Rest of stays the same. Please, fix routing and redirect issues. Because all these stuff for daily use. Without these too hard

@jim-parry
Copy link
Contributor

jim-parry commented Oct 20, 2019

Can you provide more information so we can help ...

  • $baseURL & $siteURL settings
  • context in which you call redirect, eg. the controller method code

@muradmustafayev
Copy link
Author

muradmustafayev commented Oct 21, 2019

  • app.baseURL = 'http://test.com/e/' from .env file

  • The simplest example: when I want to go admin panel, it should redirect to login page (test.com/e/admin/user/login). But redirects to test.com/admin/user/login (without folder name e)

Post.php (controller)

public function index()
{
        if(!$this->isLoggedIn())
        {
            return redirect()->to('/admin/user/login');
            // return redirect()->to('admin/user/login'); // this also not working
        }
        // some code
}
  • Little fix: URL to your CodeIgniter root. Typically this will be your base URL, WITH a trailing slash. Then it should be like this on fresh installation:
    public $baseURL = 'http://localhost:8080/';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants