feat: redirect engine with loop refusal and chain notices
- rule set: exact sources by key, patterns by literal prefix, regex by id (stdlib RE2, compiled once per source); ignore case, trailing slash, query ignore/pass, a source with ? matches its query exactly - targets: captures escaped, a relative target never leaves the site, an absolute one keeps its host - SaveRedirect validates, simulates the rule in place (exact, pattern and regex probes, 10 hops) and refuses a loop; chains answer the notice - resolve follows the chain to its final target, 410 answers gone, a runtime cycle answers not_found and is logged once
This commit is contained in:
@@ -191,3 +191,11 @@ snippet:
|
||||
invalid: The preview request is not valid.
|
||||
redirects:
|
||||
auto_created: The address changed, so a 301 from “:old” to “:new” was created. :count earlier redirects now point straight to the new address.
|
||||
loop: "This redirect would create a loop: :path. Nothing was saved."
|
||||
chain_notice: "Saved, but this redirect is part of a chain: :path. Visitors take :count hops. Point “:source” straight to “:final”."
|
||||
target_required: "Enter the address to redirect to, or choose 410 Gone."
|
||||
target_gone: "A 410 Gone rule sends visitors nowhere. Clear the target, or choose 301 or 302."
|
||||
target_invalid: "Enter a path starting with / or a full http(s) address."
|
||||
regex_invalid: "This is not a valid regular expression: :error"
|
||||
source_invalid: "Start the address with /. Use * only in a pattern."
|
||||
source_taken: "Another redirect already uses this address and match."
|
||||
|
||||
@@ -195,3 +195,11 @@ snippet:
|
||||
invalid: Żądanie podglądu jest nieprawidłowe.
|
||||
redirects:
|
||||
auto_created: Adres się zmienił, więc utworzono przekierowanie 301 z „:old” na „:new”. Wcześniejsze przekierowania (:count) prowadzą teraz bezpośrednio na nowy adres.
|
||||
loop: "To przekierowanie utworzyłoby pętlę: :path. Nic nie zapisano."
|
||||
chain_notice: "Zapisano, ale to przekierowanie jest częścią łańcucha: :path. Odwiedzający przechodzą :count przekierowania. Ustaw „:source” bezpośrednio na „:final”."
|
||||
target_required: "Wpisz adres docelowy lub wybierz 410 Usunięto."
|
||||
target_gone: "Reguła 410 Usunięto nikogo nie przekierowuje. Wyczyść adres docelowy lub wybierz 301 albo 302."
|
||||
target_invalid: "Wpisz ścieżkę zaczynającą się od / lub pełny adres http(s)."
|
||||
regex_invalid: "To nie jest poprawne wyrażenie regularne: :error"
|
||||
source_invalid: "Zacznij adres od /. Używaj * tylko we wzorcu."
|
||||
source_taken: "Inne przekierowanie już używa tego adresu i dopasowania."
|
||||
|
||||
Reference in New Issue
Block a user