Skip to content

Instantly share code, notes, and snippets.

@leobossmann
Created July 8, 2024 12:17
Show Gist options
  • Save leobossmann/f4ad6263ea639765d7cda9caf007e697 to your computer and use it in GitHub Desktop.
Save leobossmann/f4ad6263ea639765d7cda9caf007e697 to your computer and use it in GitHub Desktop.
Get all redirects from Raidboxes backend

Paste this into your console when you are on the redirects settings page in you Raiboxes admin. Adjust subdomain value if needed or just remove.

const redirects = JSON.stringify([...document.querySelectorAll('[id^=redirect_item_]')].map(el => {
    return {
        subdomain: 'www',
        source: el.querySelector('[name$=_source]').value,
        target: el.querySelector('[name$=_target]').value,
        type: el.querySelector('[name$=_type]').value,
        regex: el.querySelector('[name$=_regex]').value,
    }
}))

then just inspect the redirectsvariable and copy the contents. Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment