I have a Jekyll site deployed to Heroku. I have created a custom 404 error page in source/404.html file. The page can be found at mydomain.com/404/. But when I try to go to pages which don't exist, the custom 404 page doesn't work. And instead I get a blank, default Heroku error page.
What can be a reason for that? Note that a permalink for the page doesn't have an html extension. Can this be a problem?
Have you tried adding a permalink to the YAML front matter?
permalink: /404.html
also I have read that the 404 page is specific to GitHub pages, but worth a try
If you have followed the Heroku official Jekyll setup, you should use 2 buildpacks :
heroku/ruby
https://github.com/heroku/heroku-buildpack-static
The latter allow a static.json configuration file (at the root of your project) to customize nginx. The documentation tells you how to add custom error pages.
In your case, the static.json file should contain :
{
...
"error_page": "404.html",
...
}
Related
I'm a new beginner to Joomla. I'm trying to build a website with a sub domain of joomla (free sub domain). After successfully setting up and installing the database plus other components according to several beginners' tutorials, where I successfully upload several templates, I try to test the link of my website but all I get is this error message:
The requested page can't be found.
An error has occurred while processing your request.
You may not be able to visit this page because of:
an out-of-date bookmark/favourite
a mistyped address
a search engine that has an out-of-date listing for this site
you have no access to this page
Search
You may wish to search the site or visit the home page.
Search ...
Search ...
Home Page
If difficulties persist, please contact the System Administrator of this site and report the error below.
404 Article not found
How can I really go about solving this issue because after intensive research I have found out that this error message is very common for beginners when it comes to Joomla.
Some Suggestions:
SEF URLS
Try using a non-SEF URL to access an article to see if that works.
For example, check in Content -> Articles for a valid published article ID (the article IDs are in the last column at the right hand side of the page) and access the page using a URL like this:
http://[your-domain-name].com/index.php?option=com_content&view=article&id=xx
where xx is the article ID.
If this works, then your problem has something to do with SEF URLs or URL Rewriting.
You can temporarily disable SEF URLs and URL Rewriting in the Global Configuration.
.htaccess
A badly configured .htaccess file could cause this issue.
Assuming the .htaccess file exists in the root folder of your website (e.g. in the /public_html folder) then try copying .htaccess to .htaccess.old as a backup and reset the .htaccess file to the default settings by copying htaccess.txt to .htaccess.
htaccess.txt should also be found in the root folder of your website as part of a normal Joomla install.
Test whether this fixes the issue.
Third Party Extensions
Try disabling any SEF related third party extensions.
I have jekyll-redirect-from plugin, but it only really works for pages that aren't my root homepage.
For example, if a user types in www.mywebsite.com/index.html I want it to redirect and display the URL as www.mywebsite.com
Everything I can find about this is focused on blog posts and other pages than the index. Has anyone had this issue?
You don't need a redirect, because www.mywebsite.com/index.html and www.mywebsite.com are the same page. (The browser just shows the index file by default if you go to www.mywebsite.com.)
You need the browser to rewrite the URL, while remaining on the same page. You need to do this on the webserver.
.htaccess
If your site is on an Apache server and you have access to the server, you can use an .htaccess file to rewrite the URL from www.mywebsite.com/index.html to www.mywebsite.com.
There are online .htaccess generators like this one that help get the syntax right.
There are similar methods for rewriting URLs on nginx webservers.
GitHub Pages
If you're on a service like GitHub Pages, you can't use .htaccess. A free workaround is to use Netlify to deploy your site, because you can set up redirects on Netlify. Create a free account on Netlify and add a new site from GitHub there.
In the root of your repo, create a netlify.toml file containing this:
# Redirect /index.html to /
[[redirects]]
from = "/index.html"
to = "/"
Netlify will now handle that redirect.
I'm trying to add a page to my Jekyll Bootstrap blog and it's not showing up in the navbar. I thought that if you included the correct YAML front matter, the pages would automatically generate in the nav. I've created the page manually with a .html file extension, created the page using the command
rake page name="about.md"
... and neither one seems to work. I've restarted my server, I'm using
jekyll serve --force_polling
and I can't seem to get the page to show in my navigation ... please advise.
LINKS:
My github codebase: https://github.com/twotimes22/twotimes22.github.io
Documentation: http://jekyllbootstrap.com/usage/jekyll-quick-start.html
Thanks in advance.
Your need to put your page in the navigation group by adding group: navigation in the front matter.
See the page_list inclusion and the Jekyll bootstrapp documentation.
Edit: After watching at your repository I found a strange bug.
You have a trailing space in the front matter that the page away fronm the jekyll page listing ??
This is your front matter :
---[space]
layout: page
title: "Toto"
group: navigation
---[space]
Removing the [space] makes the page appear in the pages list. Strange !
I'm building a Jekyll site made of static pages (e.g. nothing in the _posts directory), and rather than keeping each page in the root directory, I'd like to keep it in a custom pages directory (for organization's sake).
However, I don't want this structure reflected in my URLs, so in my _config.yml I have:
permalink: /:title
With this configuration, my desired URL would be site.com/pagename, but I don't get a rendered page unless I hit site.com/pages/pagename.html.
Could anyone help me configure my build to achieve the former? Thanks!
Have you tried adding YAML Front Matter to these static pages? For example:
---
title: "pagetitle"
---
This way, Jekyll should recognize it as a Page (instead of a StaticPage) and would use your permalink configuration.
These are static pages so the entry in _config.yml is going to be ignored.
From the sounds of it you will need to create a URL rewrite rule. How to do this will depend on the web server that is servering up the pages.
When I go to the homepage url of my joomla site a 404 error shows up that simply says 404 Not Found. I have the home page set as the default in the menus item manager. Are there any other ways to fix this? Also, I am getting a 404 error when I go to the global configuration page.
I believe we have the same problem. I think your joomla site may have been hacked as well, and the fix for this is easy. You just basically need to delete files. Here's a reference to the problem http://forum.joomla.org/viewtopic.php?f=428&t=786545.