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

redirect_from works on Jekyll preview server, not on live GitHub Pages site #253

Closed
mig281 opened this issue Jun 10, 2022 · 2 comments
Closed

Comments

@mig281
Copy link

mig281 commented Jun 10, 2022

This is what I have in my file metadata (for example):

permalink: my-new-filename.html
redirect_from:
  - old-file.html

When I run bundler exec jekyll serve and start a local preview server and navigate to

http://<ip-address>:4000/old-filename.html

the server correctly redirects to

http://<ip-address>:4000/my-new-filename.html

However, when the site gets built to GitHub pages, trying to access old-filename.html throws me to

https://docs.example.com/docs.example.com/my-new-filename.html

instead of

https://docs.example.com/my-new-filename.html

What am I doing wrong?

@mig281 mig281 changed the title Redirect works on Jekyll preview server, not on live GitHub Pages site redirect_from works on Jekyll preview server, not on live GitHub Pages site Jun 10, 2022
@mig281
Copy link
Author

mig281 commented Jun 10, 2022

Upon further investigation, it seems like the generated URL is missing the https://...and the second docs.example.com...is a directory created for GitHub Pages? 😨

<html lang="en-US">
  <meta charset="utf-8">
  <title>Redirecting&hellip;</title>
  <link rel="canonical" href="docs.example.com/my-new-filename.html">
  <script>location="docs.qumulo.com/my-new-filename.html"</script>
  <meta http-equiv="refresh" content="0; url=docs.qumulo.com/my-new-filename.html">
  <meta name="robots" content="noindex">
  <h1>Redirecting&hellip;</h1>
  <a href="docs.qumulo.com/my-new-filename.html">Click here if you are not redirected.</a>

@mig281
Copy link
Author

mig281 commented Jun 10, 2022

OMG. I didn't add https:// to the url param in my _config.yml. It all works now. 🤦

@mig281 mig281 closed this as completed Jun 11, 2022
@jekyll jekyll locked and limited conversation to collaborators Jun 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants