I'm working on a symfony3 project, and i'm stuck with a problem,
We are sending emails that are twig based, with a button that has a link to our platform.
And the open document button link is the following one:
app.example.com/books/bookId/pageId
Which is generated through twig:
url("open_book", { bookId: book_id, pageId: page_id })
And the url is defined on a controller file, with annotations
@Route("/book/{bookId}/{pageId}", name="open_book")
So, the link that user gets on the email, is the original, but with double // before books, like this:
app.example.com//books/bookId/pageId
I'm working on last twig version, and I don't know if it can be symfony issue either, since its only happening on our prod environments (it works on local, yey)
If it helps, our routing.yml
app:
resource: "@BooksBundle/Controller/"
type: annotation
prefix: /
host: app.%host%
This is only happening with urls that are generated by twig. We are using jms translation and jms i18n bundles also, so I thought maybe its trying to set a null locale betwen / / like:
app.example.com/en/books/bookId/pageId
But instead of en, an empty language maybe.
Any idea to start with?
UPDATE 3/01/18 Hey! Thanks for all answers. It seems that was a problem with symfony configuration at the end...
On file parameters.yml:
router.request_context.scheme: '%env(ROUTER_REQUEST_CONTEXT_SCHEME)%'
router.request_context.host: '%env(ROUTER_REQUEST_CONTEXT_HOST)%'
router.request_context.base_url: '%env(ROUTER_REQUEST_CONTEXT_BASE_URL)%'
Then our value for base_url was /. Seems that was the real problem. Removing / on that param does the trick.
Thanks!!