Comments (9)
Note that this requires a new route parsing rule: colon-based segments. We can talk about this more, but basically need to be able to redirect segments dynamically and this is the best way I can think to do it. Open to comment.
from superstatic.
What do you mean by "segments"?
from superstatic.
URL segments. So :name
matches an entire URL segment and can be used in the destination.
e.g. {"/some/:path/here":"/other/:path"}
matches /some/thing/here
and redirects to /other/thing
from superstatic.
That makes sense. I already have a module that will make those segments very easy.
Recommendations:
- I recommend we use the "routes" object for redirects. It already handles redirects and it's one less config object in the json file.
- I recommend we configure status codes like this:
{
"routes": {
"/some/path": {
"status": "302",
"path": "/some/other/path/redirectied"
}
}
}
This makes less confusion as to where the status and the path go in the array for the user.
from superstatic.
We already handle redirects in the routing? I thought it was only rewrites. How do redirects currently work in routes?
from superstatic.
I lied. The only redirects that happen are for clean urls and directory indexes. We should add a redirects
object.
from superstatic.
Yeah, and you're right it should be plural since routes
is plural.
from superstatic.
NOTE: providing a url redirects to that url. Providing a path, redirects only to that path
from superstatic.
Let's do status
, not statusCode
. For one thing, we have generally used an underscore convention for Superstatic config, for another it's more succinct and I like it better.
from superstatic.
Related Issues (20)
- superstatic CLI config file format not compatible with firebase
- wildcard redirects not working from 'firebase serve' HOT 13
- SuperStatic site gives DNS Error HOT 8
- Infinite redirect on trailingSlash: false and cleanUrls: false HOT 12
- Incorrect 404 when trailingSlashes: true and cleanUrls: false HOT 1
- Incompatibility with GCC <4.8 HOT 2
- Feature: Show directory listings HOT 2
- Is this project actively maintained? HOT 2
- Capture Segments in Rewrites HOT 1
- Wildcard in rewrite destinations? HOT 1
- Serving site landing page results in "Unexpected error occurred" for v6.0.x HOT 1
- Parse URL-encoded symbols in paths
- high severity vulnerability HOT 1
- No HTTP/2 support in Firebase hosting emulator
- Rewrite upstream request headers
- move to esm HOT 1
- Redirect inserting unexpected slash between index and parameters
- remove `nash`
- File provider: The argument 'path' must be a string or Uint8Array without null bytes.
- simplify compression configuration HOT 5
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 superstatic.