Comments (9)
This is already implemented. See example config here:
weasel/server/config.json.sample
Line 3 in a785d75
from weasel.
As far as I understand what redirects
does is append the redirected path to the redirect target (what I would call a "relative" redirect). What I needed was an "absolute" redirect. Unless I'm missing something I don't think this issue should be closed.
from weasel.
if host
is example.com
and another.host
is another.example.com
, then
"host/": "https://another.host"
will redirect:
example.com
tohttps://another.example.com
example.com/foo/bar?foo=bar
tohttps://another.example.com/foo/bar?foo=bar
Isn't that what you need?
from weasel.
No I need to be able to redirect to a different path, not just a different host. If you look at my initial comment you'll see for example:
"/getting-started.html": "https://goa.design/learn/guide"
which redirects:
"goa.design/getting-started.html" to "https://goa.design/learn/guide"
from weasel.
Ah, I see. Sorry for misreading. That can be done with the std http package, no need for weasel:
http.Handle("/getting-started.html", http.RedirectHandler("https://goa.design/learn/guide", 301))
from weasel.
Right that's how I ended up implementing the "absolute redirect" feature, just thought it would be useful for these redirects to also appear in the config to keep all these things in one place.
from weasel.
Right. I'm trying to move weasel away from imposing a certain config format. Working on a change to leave the config part up to the user and provide some examples instead.
from weasel.
Sounds good, looking forward to it!
from weasel.
Cool. I'll mention you in a PR for a review. Thanks!
from weasel.
Related Issues (10)
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 weasel.