Comments (6)
It may bit different from both of your needs, but on the same topic. What about passing through hash and query params from the first request to the new URL?
from jekyll-redirect-from.
It would be tremendously useful to be able to redirect based on URL parameters. See this Stack Overflow question.
from jekyll-redirect-from.
I think you both might be talking about different things.
from jekyll-redirect-from.
@parkr Yes I think you are right. I was asking to append a hash or query parameter to the redirect URL. For example:
VISIT http://google.com/outdated-page
REDIRECT_TO http://google.com/new-page?from=outdated-page
or
VISIT http://google.com/oudated-page
REDIRECT_TO http://google.com/new-page#modal
This could be a config option when setting redirect_from
in the target page's top matter. The syntax could be extended (and remain backwards compatible) to be something like:
redirect_from:
- /path/to/howdy.html
- path: /path/to/old.html
params:
- from: old
It sounds like @danvk is looking for something like
VISIT http://google.com/oudated-page?q=abc
IF q
REDIRECT_TO http://google.com/new-page
ELSE
REDIRECT_TO http://google.com/coolest-page
This doesn't seem possible because the "/oudated-page" path can only resolve to a single file, and the <meta http-equiv="refresh">
tag does not allow conditionals. It would likely require JavaScript to function correctly.
from jekyll-redirect-from.
I'd be very happy if I could include something like this in the frontmatter:
redirect_from:
- /foo?bar=baz
- /foo?p=2
from jekyll-redirect-from.
@danvk That's not possible with Jekyll alone because Jekyll is simply a static file generator.
For the path "/foo" there exists one real file, which is likely "/foo/index.html". Inside the HTML file, there is a single <meta http-equiv="refresh" content="0;/new-foo">
tag that your browser reads and follows. There is no possibility of branching, i.e. checking URL parameters.
from jekyll-redirect-from.
Related Issues (20)
- Redirect pages not working when deployed from Netlify HOT 3
- All redirection urls are seen as pages by Jekyll HOT 3
- Automatically redirecting both with and without trailing slash HOT 1
- Time for a new release HOT 1
- Add ability to specify a list of redirects in `_config.yml` HOT 1
- `redirect_from` does not work with file extensions HOT 3
- `redirect_from` works on Jekyll preview server, not on live GitHub Pages site HOT 2
- Time for a new release HOT 1
- Time for a new release HOT 1
- Time for a new release HOT 1
- `redirect_from` is adding `site.baseurl` to `site.url` (Duplicates the baseurl on Github Pages) HOT 2
- Option to set a built default redirect for whole site. HOT 1
- File Redirection and blank page after downloading HOT 1
- Time for a new release HOT 3
- Chokes on numeric directory names
- Error when redirect from/to collisions exist at build time (again)
- Does this plugin work with the `config.toml` format?
- Noindex prevents search engines from finding new URLs HOT 5
- Currently after executing the setup.sh I've tried to execute the usage part but it failed because a lot of dependencies were missing. I installed all of them and it worked, but I don't know why that manual step, maybe I failed something in the setup.
- _Originally posted by @mistycaseyward12 in https://github.com/mistycaseyward12/redesigned-goggles/issues/1_
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jekyll-redirect-from.