Lektor server doubles subfolder in url without obvious reason - lektor

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.

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/)

Related

Umbraco adds extra slash to beginning of page URL

Umbraco 7.12.4
Recently I renamed a node in Umbraco. It used to be called "Projects". I want it to be called "My Projects". After renaming it, no matter whether I put the name back to the original value or set an entirely new value, the following occurs:
Change page name
Click on properties. The Url appears correct, without an extra /
Access the website. The website works correctly
Access the website AGAIN. This page now redirects to http://my-projects and fails.
Click on properties. The Url now appears as in the image below.
I have checked routes. Cleared URL redirects. Emptied recycle bin. Tried page names that have never existed before.
Any ideas? I am pulling my hair out. Thanks!
The problem was related to a missing host name - look at comments :-)

Problem with joomla with photos and redirection

I deleted the pictures through the Joomla panel and I get such an error on the page as you can see in the picture. How to deal with this?
How to add redirection but without domain?
Your first issue about the pictures seems to be an issue with the component you're using, which is com_joomgallery in your case. When you delete the picture, it gets deleted but somehow its showing up in your JoomGallery image listing and so is the error.
Can you let me know from where you've deleted the photos? Was it from JoomGallery or from somewhere else?
If you haven't deleted them from JoomGallery then that's the reason for your issue, because JoomGallery database table still have those records and when it tries to list them its unable to find the thumbnails/images that you've deleted.
About your second question, how are you redirecting to external URL? If you're trying to open the external URL from an anchor tag try doing it like
Link
But you're using Route::_ to open the external URL, then don't. As Route::_ isn't used for external links but is meant only for internal URLs. If you want to open or redirect using Joomla, then try like this
$url = Uri::getInstance("//www.facebook.com");
$url->setScheme("https");
$externalURL = $url->toString();
echo "<a href='$externalURL'>Link</a><br>";
I hope this helps.

How to set 404 page using xpath

I am working with Umbraco 7.5.2 and I am trying to set a custom 404 page.
I am hosting 2 totally different sites on the same Umbraco.
I've created my page types and pages in the back office and in umbracoSettings.config I have added this:
<errors>
<error404>//errorListFolder/page[#nodeName = '404']</error404>
Which will find the page with name 404 from type page right below errorListFolder.
But this page is the same for both of my sites (shows the one on the first site). How can I fix it to show the relevant error page on each site?
I have tried
<error404>$site//errorListFolder/page [#nodeName='404']</error404>
But it doesn't find anything and I will end up with the basic error page of umbraco
And this is my structure (I removed the other nodes for simplicity)
Comment
Thanks to Marcin, I could fix it with Nibble.Umbraco.PageNotFoundManager. It is a wonderful tool! but I need to mention that you have to set umbracoSettings.config manually back to normal, otherwise it won't work.
I had the xpath in that file and no matter what I select in the back office, I couldn't see my page. then I change that back to 1 and it is working like a charm :)
You can access specific trees by going from $root element. Check my solution from one of our projects:
<error404>
<errorPage culture="pl-PL">$root/homePage[#nodeName='PL']/hTMLContentPage[#nodeName='content not found TERROR - 808']</errorPage>
<errorPage culture="en-US">$root/homePage[#nodeName='EN']/hTMLContentPage[#nodeName='content not found TERROR - 808']</errorPage>
<errorPage culture="default">$root/homePage[#nodeName='PL']/hTMLContentPage[#nodeName='content not found TERROR - 808']</errorPage>
</error404>
It takes first node with original name 'content not found TERROR - 808' from node of type 'homePage' and specific nodeName as you can see above.
For your scenario, you should try Umbraco Page Not Found Manager made by Tim Geyssens: https://our.umbraco.org/projects/backoffice-extensions/umbraco-page-not-found-manager/ (uHangout: https://www.youtube.com/watch?v=bFL0xUhRerI). Probably it's something what you're looking for. It may be hard or even impossible to arrange it with basic error404 settings in config file, especially if you want to keep some culture depending 404's underneeth previously accesed tree nodes.
Hope that it help you!

Magento Homepage Keeps on redirecting to a 404 page

I have been on this issue for almost a week now and have been research all over the net for answers but i could not find one.
Problem:
each time i access the homepage of my site, it results to a 404 error.
ex.
http://www.domain.com ---> redirects to 404
http://www.domain.com/home ---> enters to the cms page that i set as my homepage
I have already run the magento cleanup scripts but it was not able to solve the problem.
ERROR MESSAGE:
Whoops, our bad...
The page you requested was not found, and we have a fine guess why.
If you typed the URL directly, please make sure the spelling is correct.
If you clicked on a link to get here, the link is outdated.
What can you do?
Have no fear, help is near! There are many ways you can get back on track with Magento Store.
Go back to the previous page.
Use the search bar at the top of the page to search for your products.
Follow these links to get you back on track!
Store Home | My Account
I've got a similar error and would like to post my solution here. The case was exactly the same for me: all the pages, categories, etc. worked perfectly, but the home page showed a 404 error.
I looked into the core_url_rewrite table and discover that there was an entry with the «request_path» field empty. So this entry was rewriting my base url and that was the reason for the 404 in my case. I just deleted it.
Hope this helps to other people.
If you are using the Enterprise version you should check the table enterprise_url_rewrite. The query below should help you:
select * from enterprise_url_rewrite where request_path="";
delete from enterprise_url_rewrite where request_path="";
Check the folowing:
1- System->Configuration->general->Web->secure
Base URL: http://www.your-site.com/
(be sure you are in the right shop site from the top left of the system)
2- System->Configuration->general->Web->Default Pages
Default Web URL: cms (yes just cms)
CMS Home Page: select your cms page
Default No-route URL: cms/index/noRoute
3- check your server has rewrites otherwise
System->Configuration->general->Web->Search Engines Optimization
Use Web Server Rewrites: No
4- something wrong with your .htaccess replace the file with the one in your original installer.
Because StackOveflow has this stupid rule that I must have a certain number of "points" before I can chime in on discussions I need to make this as a "new answer":
open-ecommerce.org's #2 also solved the problem for me
2- System->Configuration->general->Web->Default Pages Default Web URL:
cms (yes just cms) CMS Home Page: select your cms page Default
No-route URL: cms/index/noRoute
for me this was set to "index". No clue how it worked before, or why it was set that way, but after updating it broke and this was the fix for me.
Note that I did also truncate the 'core_url_rewrite' table as well in troubleshooting. If you don't change urls at all, or often, then that's no big deal. But if you are chaning URLs often, then you'll loose your 301 redirect history (all old urls will 404 going forward).
Open-ecommerce.org solution # 2 , worked for me.
I initially set my "Defaul Web URL" as the URL of the homepage. Similar to what I did with the baseURL but I was wrong.
I changed it to "CMS"
From there, it all works.
Thanks!

Set up a cms page for Magento

I've been trying to set up a CMS page in magento to be the home page, and it's just killing me - how hard should this be? no matter what I set up, I get a 404.
Can somebody tell me basic steps to set up a CMS page as the home page for a Magento install, living at:
http://www.mymagentoinstall.com/
I can't have the url key for the CMS page be empty, but setting the default page in the System->Config->Default Pages->CMS Home Page (which seems like it should work), still gives me a 404.
thx for any help
Hours of head banging later .... I’ve changed the parameter “Use Web Server Rewrites” on System -> Configuration -> Web from Yes to No. And it worked! My provider set this by default, so had to change it. Only downside is that I now get the /index.php extension added.
Did you check to make sure that the page was enabled and visible in your store view?
Ok - figured it out. In the System->Config->Web, the Default Web URL needs to be 'cms' (no quotes) - I guess that tells Magento to use the cms page instead of a default url.
In csm - pages create some html in the page, eg start simple with My Homepage.
Give it a name and take care the url is "home" (without the quotes.
Now go to system - configuration - web and select your homepage (name) from the dropdown where in lets you choose the homepage.
That should do it.
Your CMS Page Identifier should be home
I was running into the same issue. No matter what I did, the home page came back as a 404. I had it working on a test server (with a different database) and compared the options side by side. Absolutely nothing worked, the home page, named 'home' and the 'cms' was properly set, mod_rewrite working, htaccess file just peachy...but domain.com/ wouldn't work. after a few hours I saw that domain.com/home/ did, though I swear it hadn't been.
Finally I wiped the blood off the keyboard where I'd been smashing my head against it and went into url rewrite management and set id path to '/', request path to '/' and target path to '/home/' and it works like it should have all along. Hope this helps someone else!

Resources