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

Need to remove .html from files? #297

Open
peavers opened this issue Sep 22, 2017 · 4 comments
Open

Need to remove .html from files? #297

peavers opened this issue Sep 22, 2017 · 4 comments

Comments

@peavers
Copy link

peavers commented Sep 22, 2017

Hello,

I can't access anything but the homepage without adding .html to the end of the url. For example example.com/posts returns a 404 but example.com/posts.html returns the page.

I'm using cloudfront but everything (including the creation of the bucket) was handled with S3, and the posts.html file has the correct content-type set, am I just missing something obvious here?

Surely I don't have to create redirect rules in the config for every single page do I?

@laurilehmijoki
Copy link
Owner

You should not have to create redirect rules in this kind of a case. Do your local files end with the .html suffix? If yes, then try removing the suffix.

@peavers
Copy link
Author

peavers commented Sep 22, 2017

Hmm I'm brand new to Jekyll so this could contribute to my issues...

I have posts.md which contains standard Jekyll stuff, I've just tried removing the .html from the permalink but still no deal. posts.md contains the following

---
layout: post-list
title: Posts
description: "List of posts"
permalink: /posts.html
---

posts.md ends up being posts.html in the s3 bucket after building and pushing;

@nabilfreeman
Copy link

@peavers change permalink from /posts.html to /posts/!

@jeffblake
Copy link

jeffblake commented Dec 13, 2017

Using a trailing slash for the Jekyll permalink will get the URLs to work (by creating an index.html for the page in a subfolder), but the only problem with this is that if you visit the URL without the trailing slash, S3 does a 302 redirect to the trailing slash version. Not ideal, but I'm hoping that with rel=canonical meta tags added, and ensuring you are always linking to the trailing slash version.... it should be okay from an SEO standpoint? Any ideas?

Relevant discussion here: #233

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

No branches or pull requests

4 participants