HelloZeroNet / HelloZeroNet/ZeroNet
Feature Request: Add URL rewriting to sites
- Lenguaje dominante
- JavaScript
- Estrellas
- 18.8k
- Forks
- 2.3k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
Allow each site to specify an URL rewriting scheme in `content.json`.
Proposed syntax:
```
"rewrite_rules": [
{ match: "files/.*", terminate: true },
{ match: "(.*)", replace: "index.html?url=\1", terminate: true },
]
```
The rewriting rules are:
* The URL which is checked to match against the regexp is the part after the site address, non including initial backslash.
* The matching rules are applied recursively until one with `terminate = true` is found. The first matched rule is the one which is applied at each step, each time starting from the first one.
* If the `replace` key is missing the returned string is not modified.
The final url should be then internally rendered and such page returned.
There should not be any html redirect.
If after 100 rewrites the url did not find a terminate condition, the site will log an error and the original request will be made.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Comienza rastreando cómo se carga el content.json de un sitio y cómo se renderizan internamente las URL entrantes. Define el comportamiento de rewrite_rules a partir de la sintaxis propuesta, incluido el emparejamiento recursivo, la sustitución, la terminación y el límite de 100 reescrituras; se considerará completado cuando las páginas reescritas se rendericen internamente sin una redirección HTML y las reescrituras no terminantes registren un error antes de realizar la solicitud original.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Área
- backend
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100