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

Subdirectory is added again when using $routes->redirect #12295

Closed
1 task done
Bird87ZA opened this issue Jun 26, 2018 · 1 comment
Closed
1 task done

Subdirectory is added again when using $routes->redirect #12295

Bird87ZA opened this issue Jun 26, 2018 · 1 comment

Comments

@Bird87ZA
Copy link
Contributor

Bird87ZA commented Jun 26, 2018

This is a (multiple allowed):

  • bug

  • CakePHP Version: 3.6.5

  • Platform and Target: AWS Hosted server (Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-129-generic x86_64)) PostgreSQL DB. Website is hosted under www.example.com, CakePHP runs from www.example.com/webapp

What you did

I created a shortlink for a specific route in my routes.php file like so:

$routes->redirect(
    '/g/:id',
    ['controller' => 'Jobs', 'action' => 'view'],
    ['pass' => ['id'], 'persist' => true]
);

What happened

I am being redirected to www.example.com/webapp/webapp/jobs/view/5

What you expected to happen

I expect it to redirect me to www.example.com/webapp/jobs/view/5

More info

I did quite a few debugging and it seems that the bug slips in around the Router::reverse() function. You can see my original discussion around the issue with @ndm2 here.

@markstory
Copy link
Member

Pull request open now.

markstory added a commit that referenced this issue Jun 28, 2018
markstory added a commit that referenced this issue Jun 28, 2018
Merge branch 'issue-12296' into master

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

No branches or pull requests

3 participants