{"id":19210911,"url":"https://github.com/mathieuprog/redirect","last_synced_at":"2025-06-25T22:35:48.815Z","repository":{"id":41467406,"uuid":"225676210","full_name":"mathieuprog/redirect","owner":"mathieuprog","description":"Router macro for redirecting a request at a given path to another","archived":false,"fork":false,"pushed_at":"2023-07-22T03:29:00.000Z","size":13,"stargazers_count":21,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-16T03:07:29.076Z","etag":null,"topics":["elixir","elixir-lang","plug","redirect","router"],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mathieuprog.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-03T17:17:38.000Z","updated_at":"2025-01-13T17:46:32.000Z","dependencies_parsed_at":"2024-11-09T13:40:01.724Z","dependency_job_id":null,"html_url":"https://github.com/mathieuprog/redirect","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"7c685581186fcd3c4de4ea6b4482851518181ad7"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/mathieuprog/redirect","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathieuprog%2Fredirect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathieuprog%2Fredirect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathieuprog%2Fredirect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathieuprog%2Fredirect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mathieuprog","download_url":"https://codeload.github.com/mathieuprog/redirect/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathieuprog%2Fredirect/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261964634,"owners_count":23237453,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elixir","elixir-lang","plug","redirect","router"],"created_at":"2024-11-09T13:39:47.413Z","updated_at":"2025-06-25T22:35:48.786Z","avatar_url":"https://github.com/mathieuprog.png","language":"Elixir","readme":"# Redirect\n\n**Redirect** provides a macro for your router to redirect a request at a given\npath to another.\n\nIn your `router.ex` file, use the `redirect/3` macro to redirect a request:\n\n```elixir\nimport Redirect\n\nredirect \"/path\", \"/new-path\", :permanent, preserve_query_string: true\n```\n\n⚠️ `redirect/3` doesn't work inside scopes (`scope/2`/`scope/3`/`scope/4`)\n\nThe third argument passed to `redirect/3` must be either `:permanent` or\n`:temporary`. This setting sets the HTTP status code to 301 or 302 respectively.\n\nThe fourth optional argument allows to specify whether the query string must be preserved in the\ntarget URL or not (defaults to false).\n\nNote that `Plug.Conn` will be halted right after redirecting.\n\nYou may also import `:redirect`'s formatter configuration by importing\n`redirect` into your `.formatter.exs` file (this allows for example to keep\n`redirect \"/path\", \"/new-path\", :permanent` without parentheses when running `mix format`).\n\n```elixir\n[\n  import_deps: [:ecto, :phoenix, :redirect],\n  #...\n]\n```\n\n## Installation\n\nAdd `redirect` for Elixir as a dependency in your `mix.exs` file:\n\n```elixir\ndef deps do\n  [\n    {:redirect, \"~\u003e 0.4.0\"}\n  ]\nend\n```\n\n## HexDocs\n\nHexDocs documentation can be found at [https://hexdocs.pm/redirect](https://hexdocs.pm/redirect).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathieuprog%2Fredirect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathieuprog%2Fredirect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathieuprog%2Fredirect/lists"}