{"id":14062738,"url":"https://github.com/burchill/redirect_repo","last_synced_at":"2025-07-29T14:31:23.443Z","repository":{"id":93540653,"uuid":"206858253","full_name":"burchill/redirect_repo","owner":"burchill","description":"A cheap way of redirecting to a local IP","archived":false,"fork":false,"pushed_at":"2023-06-19T22:10:04.000Z","size":17,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-13T07:03:10.658Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"HTML","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/burchill.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":"2019-09-06T19:08:39.000Z","updated_at":"2024-08-13T07:03:13.731Z","dependencies_parsed_at":"2023-03-23T13:33:08.807Z","dependency_job_id":null,"html_url":"https://github.com/burchill/redirect_repo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/burchill%2Fredirect_repo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/burchill%2Fredirect_repo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/burchill%2Fredirect_repo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/burchill%2Fredirect_repo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/burchill","download_url":"https://codeload.github.com/burchill/redirect_repo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228022742,"owners_count":17857593,"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-08-13T07:02:12.106Z","updated_at":"2024-12-04T00:30:43.729Z","avatar_url":"https://github.com/burchill.png","language":"HTML","funding_links":[],"categories":["HTML"],"sub_categories":[],"readme":"# redirect_repo\n## A cheap way of redirecting to a local IP\n\nI have a RaspberryPi Flask website running on my local network.  Instead of remembering the Pi's IP address or configuring my DNS, etc., I have come up with this system, which redirects a public URL to my private local site.  I do this via the following.\n\nFirst, I have a domain name that refers to my GitHub Pages site (zachburchill.ml --\u003e burchill.github.io), using the normal CNAME method.\nThen, I added an additional CNAME record to the registrar's account, for the subdomain `scale.zachburchill.ml` (named that because my local site is built around tracking my weight). \n\nNow my registrar's record table looks like this:\n\n| Name | Type | TTL | Target |\n--------|-------|------|----------|\n| | A | 14440| 192.30.252.153 |\n| | A | 14440| 192.30.252.154 |\n| WWW | CNAME | 14440 | burchill.github.io |\n| SCALE | CNAME | 3600 | burchill.github.io |\n\nThen I added the `CNAME` file to this directory and included the `index.html` file that automatically redirects the browser to the local site.  \n\nThis worked well, but I realized I couldn't do something like `http://scale.zachburchill.ml/weight_tracker/` and have it redirect to `http://\u003clocal_ip\u003e/weight_tracker/` since the `weight_tracker` page doesn't exist as a page in this public repo.  I came up with a clever (in my opinion) workaround: since non-existent page requests are (generally) redirected to the `/404.html/` page, I could make a 404 page that would get the URL the user was *attempting* to visit and redirect them to that page on the local site (via Javascript). \n\nWith that, I can type `scale.zachburchill.ml/weight_tracker/` and have it directed to `http://\u003clocal_ip\u003e/weight_tracker/` automatically.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fburchill%2Fredirect_repo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fburchill%2Fredirect_repo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fburchill%2Fredirect_repo/lists"}