{"id":15475413,"url":"https://github.com/dhellmann/gowhere","last_synced_at":"2025-02-23T10:41:20.591Z","repository":{"id":143288888,"uuid":"163605971","full_name":"dhellmann/gowhere","owner":"dhellmann","description":"Golang implementation of whereto for testing Apache redirect instructions","archived":false,"fork":false,"pushed_at":"2019-01-05T21:45:31.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-04T22:34:48.676Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dhellmann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-12-30T17:41:20.000Z","updated_at":"2019-01-05T21:45:32.000Z","dependencies_parsed_at":"2023-05-10T22:00:12.141Z","dependency_job_id":null,"html_url":"https://github.com/dhellmann/gowhere","commit_stats":{"total_commits":48,"total_committers":1,"mean_commits":48.0,"dds":0.0,"last_synced_commit":"6c8b41cd1ec7205251855c07db1def26721cf774"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhellmann%2Fgowhere","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhellmann%2Fgowhere/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhellmann%2Fgowhere/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhellmann%2Fgowhere/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dhellmann","download_url":"https://codeload.github.com/dhellmann/gowhere/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240304573,"owners_count":19780312,"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":[],"created_at":"2024-10-02T03:12:43.743Z","updated_at":"2025-02-23T10:41:20.569Z","avatar_url":"https://github.com/dhellmann.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gowhere -- Tool for testing Apache redirect instructions\n\ngowhere is a Golang re-implementation of\n[whereto](https://docs.openstack.org/whereto/), and is used to test\nthe `redirect` and `redirectmatch` directives in an htaccess file to\ndetect incorrect redirection, cycles, and excessive hops.\n\n## Example\n\nThe `example` directory contains 2 input files that can be used to\ndemonstrate how gowhere works:\n\n    $ go get github.com/dhellmann/gowhere/cmd/gowhere\n\n    $ cd $GOPATH/src/github.com/dhellmann/gowhere\n\n    $ $GOPATH/bin/gowhere example/htaccess example/tests.txt\n    Unexpected rule matched check on line 7: '/old_root/index.html' should produce 301 '/new_root/not_index.html'\n        /old_root/index.html -\u003e 301 /new_root/index.html [line 9]\n    Cycle found from rule on line 11: '/cycle/a' should produce 301 '/cycle/d'\n        /cycle/a -\u003e 301 /cycle/b [line 11]\n        /cycle/a -\u003e 301 /cycle/c [line 12]\n        /cycle/a -\u003e 301 /cycle/a [line 13]\n    Untested rule [line 4] redirect /project/def/new_page.html 301 /project/def/other_page.html\n    Untested rule [line 7] redirectmatch ^/renamed/new1/ 301 /renamed/new2/\n    Untested rule [line 12] redirect /cycle/b 301 /cycle/c\n    Untested rule [line 13] redirect /cycle/c 301 /cycle/a\n\n    2 failures\n\n    $ echo $?\n    1\n\n## Inputs\n\nTo test a set of redirects, `gowhere` needs the input `.htaccess`\nfile and another input file with test data.\n\nThe `.htaccess` file should contain `Redirect` and\n`RedirectMatch` directives. Blank lines and lines starting with\n`#` are ignored. For example, this input includes 6 rules:\n\n    # Redirect old top-level HTML pages to the version under most recent\n    # full release.\n    redirectmatch 301 ^/$ /current-release/\n    redirectmatch 301 ^/index.html$ /current-release/\n    redirectmatch 301 ^/projects.html$ /current-release/projects.html\n    redirectmatch 301 ^/language-bindings.html$ /current-release/language-bindings.html\n\n    # Redirect subpage pointers to main page\n    redirect 301 /install/ /current-release/install/\n    redirect 301 /basic-install/ /current-release/install/\n\n    # this is gone and never coming back, indicate that to the end users\n    redirect 410 /obsolete_content.html\n\nThe test data file should include one test per line, including 3\nparts: the input path, the expected HTTP response code, and the\n(optional) expected output path. For example:\n\n    / 301 /current-release/\n    / 301 /current-release\n    /install/ 301 /current-release/install/\n    /no/rule 301 /should/fail\n    /obsolete-content.html 410\n\n    # verify that this path is not redirected\n    /current-release/index.html 200\n\n\n## To-do list\n\n- pcre regexes?\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhellmann%2Fgowhere","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdhellmann%2Fgowhere","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhellmann%2Fgowhere/lists"}