Search code examples
lektor

Lektor server doubles subfolder in url without obvious reason


I am trying to export an existing php-based dynamic webpage into a lektor project which up to now really worked well.

Unfortunately one problem is giving me a headache: While my navigation works perfectly with every page and subpage, links to subpages in the content section don't.

E.g. if I set a relative path like

[My Link to Subpage](/peter/personalinfo)

it is correctly shown in the browser view. If I hover the mouse over the link the browser shows the correct url 127.0.0.1:5000/peter/personalinfo. But if I click it I get

Not Found

The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.

and the url in the address field shows

127.0.0.1:5000/peter/peter/personalinfo

So I click the correct url but the browser calls the wrong url and of course can't find anything there. I don't understand how this doubling can happen. I naively would expect that if I clicked a link the browser would exactly look at that address. But it seems like the server is redirecting to the malformed url. And yes, it does so with any link to a subpage.

the navigation looks like this:

Home
News
Peter
-- Personalinfo
-- Contact
-- Portfolio
Bob
-- Personalinfo
-- Contact
-- Portfolio

Any idea why this happens and how to change it?

Update: The problem doesn't appear with the built static page on a webserver.


Solution

  • there is an open issue (#997) that is already fixed and will be released soon. But you can fix this yourself, just append a slash at the end of your link [My Link to Subpage](/peter/personalinfo/)