Managing URL redirects via Pack's Admin
If you have any old URLs you want to point to your new site, please follow the steps below to add a new redirect:
- Navigate to Pack’s admin.
- Click on Settings > URL.
- Click on Create redirect.
- Input the URL you want to redirect from and the URL you want to redirect to, and choose the status code to use. Check 'force' to force the redirect to occur even if the source route exists.
- Click on Create redirect.
- Allow up to 5 minutes for the redirect to take effect.
Managing URL redirects via Shopify’s Admin
If you don’t want to automatically redirect a URL to your Pack site, you can do so by following the steps below:
- Navigate to Shopify’s admin > Online Store > Themes > Three dots > Edit code.
- Click on
theme.liquid
. - Insert the following snippet:
<script>
const base = 'https://packdigital.com'; // your storefront URL, e.g. https://packdigital.com
const path = window.location.pathname;
const params = window.location.search;
const hash = window.location.hash;
const to = `${base}${path}${params}${hash}`;
// Add any paths you do NOT want to redirect to here
const viewablePaths = ['/apps/', '/tools/', '/account'];
const appProxyPaths = viewablePaths;
const isNotAppProxyUrl = appProxyPaths.every(proxyPath => !path.startsWith(proxyPath));
if(isNotAppProxyUrl){
window.parent.location.href = to;
}
</script>
- Click on 'Save'.
- Allow up to 5 minutes for the redirect to take effect.