Questions about redirects - DNS issues and rule format

Issue:

  • I am redirecting my current site hosted on Netlify to another property not hosted on Netlify using a _redirects file.
  • I am trying to redirect https://www.albion.mediahttps://www.tryjraft.com
  • Immediately after build, the redirect works correctly, but after around 10-20 seconds, the redirect stops working. I have tried over 30 different combinations of redirect files to no avail, and this seems like a bug on Netlify’s side, not user error.

The redirect file is the following:
‘/* https://www.tryjraft.com

Netlify Site name: ‘albion-landing-page.netlify.app’

Deploy Summary:

Build Log:
3:39:11 PM: Build ready to start
3:39:15 PM: build-image version: b0258b965567defc4a2d7e2f2dec2e00c8f73ad6
3:39:15 PM: build-image tag: v3.4.1
3:39:15 PM: buildbot version: c6376102eedf4be6c6e5d685c7141e2eb612d47d
3:39:16 PM: Fetching cached dependencies
3:39:16 PM: Starting to download cache of 264.8MB
3:39:18 PM: Finished downloading cache in 2.373727183s
3:39:18 PM: Starting to extract cache
3:39:25 PM: Finished extracting cache in 6.876022668s
3:39:25 PM: Finished fetching cache in 9.307551987s
3:39:25 PM: Starting to prepare the repo for build
3:39:25 PM: Preparing Git Reference refs/heads/master
3:39:27 PM: Starting build script
3:39:27 PM: Installing dependencies
3:39:27 PM: Python version set to 2.7
3:39:27 PM: Started restoring cached node version
3:39:30 PM: Finished restoring cached node version
3:39:31 PM: v10.22.1 is already installed.
3:39:32 PM: Now using node v10.22.1 (npm v6.14.6)
3:39:32 PM: Started restoring cached build plugins
3:39:32 PM: Finished restoring cached build plugins
3:39:32 PM: Attempting ruby version 2.6.2, read from environment
3:39:33 PM: Using ruby version 2.6.2
3:39:33 PM: Using PHP version 5.6
3:39:33 PM: 5.2 is already installed.
3:39:33 PM: Using Swift version 5.2
3:39:33 PM: Started restoring cached go cache
3:39:35 PM: Finished restoring cached go cache
3:39:35 PM: Installing Go version 1.12
3:39:35 PM: unset GOOS;
3:39:35 PM: unset GOARCH;
3:39:35 PM: export GOROOT=’/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64’;
3:39:35 PM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64/bin:${PATH}";
3:39:35 PM: go version >&2;
3:39:35 PM: export GIMME_ENV=’/opt/buildhome/.gimme_cache/env/go1.12.linux.amd64.env’;
3:39:35 PM: go version go1.12 linux/amd64
3:39:35 PM: Installing missing commands
3:39:35 PM: Verify run directory
3:39:36 PM: ​
3:39:36 PM: ┌─────────────────────────────┐
3:39:36 PM: │ Netlify Build │
3:39:36 PM: └─────────────────────────────┘
3:39:36 PM: ​
3:39:36 PM: ❯ Version
3:39:36 PM: @netlify/build 4.8.1
3:39:36 PM: ​
3:39:36 PM: ❯ Flags
3:39:36 PM: deployId: 5f813aefcbf31b00079da150
3:39:36 PM: mode: buildbot
3:39:36 PM: ​
3:39:36 PM: ❯ Current directory
3:39:36 PM: /opt/build/repo
3:39:36 PM: ​
3:39:36 PM: ❯ Config file
3:39:36 PM: No config file was defined: using default values.
3:39:36 PM: ​
3:39:36 PM: ❯ Context
3:39:36 PM: production
3:39:36 PM: ​
3:39:36 PM: ❯ Loading plugins
3:39:36 PM: - netlify-plugin-submit-sitemap@0.2.2 from Netlify app
3:39:36 PM: - @netlify/plugin-sitemap@0.5.0 from Netlify app
3:39:36 PM: ​
3:39:36 PM: ┌─────────────────────────────────────────────────────┐
3:39:36 PM: │ 1. onPostBuild command from @netlify/plugin-sitemap │
3:39:36 PM: └─────────────────────────────────────────────────────┘
3:39:36 PM: ​
3:39:36 PM: Creating sitemap from files…
3:39:36 PM: Sitemap Built! sitemap.xml
3:39:36 PM: ​
3:39:36 PM: (@netlify/plugin-sitemap onPostBuild completed in 23ms)
3:39:36 PM: ​
3:39:36 PM: ┌─────────────────────────────────────────────────────────┐
3:39:36 PM: │ 2. onSuccess command from netlify-plugin-submit-sitemap │
3:39:36 PM: └─────────────────────────────────────────────────────────┘
3:39:36 PM: ​
3:39:36 PM: Going to submit sitemap to google
3:39:36 PM: --> URL: https://www.google.com/ping?sitemap=https://www.albion.media/sitemap.xml
3:39:36 PM: Going to submit sitemap to bing
3:39:36 PM: --> URL: https://www.bing.com/ping?sitemap=https://www.albion.media/sitemap.xml
3:39:36 PM: Going to submit sitemap to yandex
3:39:36 PM: --> URL: https://webmaster.yandex.ru/ping?sitemap=https://www.albion.media/sitemap.xml
3:39:37 PM: ✓ DONE! Sitemap submitted succesfully to google
3:39:37 PM: ✓ DONE! Sitemap submitted succesfully to bing
3:39:37 PM: ✓ DONE! Sitemap submitted succesfully to yandex
3:39:37 PM: ​
3:39:37 PM: (netlify-plugin-submit-sitemap onSuccess completed in 800ms)
3:39:37 PM: ​
3:39:37 PM: ┌─────────────────────────────┐
3:39:37 PM: │ Netlify Build Complete │
3:39:37 PM: └─────────────────────────────┘
3:39:37 PM: ​
3:39:37 PM: (Netlify Build completed in 1.3s)
3:39:37 PM: Caching artifacts
3:39:37 PM: Started saving build plugins
3:39:37 PM: Finished saving build plugins
3:39:37 PM: Started saving pip cache
3:39:37 PM: Finished saving pip cache
3:39:37 PM: Started saving emacs cask dependencies
3:39:37 PM: Finished saving emacs cask dependencies
3:39:37 PM: Started saving maven dependencies
3:39:37 PM: Finished saving maven dependencies
3:39:37 PM: Started saving boot dependencies
3:39:37 PM: Finished saving boot dependencies
3:39:37 PM: Started saving go dependencies
3:39:39 PM: Finished saving go dependencies
3:39:39 PM: Build script success
3:39:39 PM: Starting to deploy site from ‘’
3:39:39 PM: Creating deploy tree
3:39:39 PM: Creating deploy upload records
3:39:39 PM: 1 new files to upload
3:39:39 PM: 0 new functions to upload
3:39:39 PM: Starting post processing
3:39:39 PM: Post processing - HTML
3:39:39 PM: Post processing - header rules
3:39:39 PM: Post processing - redirect rules
3:39:39 PM: Post processing done
3:39:40 PM: Site is live
3:40:16 PM: Finished processing build request in 1m0.729054457s

@alex.pan1021 From what I can tell, your DNS settings are totally borked on each of these sites.

Albion is registered with GoDaddy, and is using GoDaddy DNS, but you also have Netlify name servers specified in your GoDaddy DNS. Your apex domain is on an nginx server while the www sub-domain is on Netlify. You also seem to have a CNAME for the www sub-domain that points to your Netlify albion-landing-page site.

Tryjraft, on the other hand, is registered with NameCheap, and is using AWS for DNS. Your www sub-domain is pointing at your GitHub URL, probably due to your CNAME entry. Your A record for the apex domain is not pointing at Netlify’s load balancer IP address. Your A records for the www sub-domain is pointing at your GitHub URL and four IP addresses. Neither your apex nor www sub-domain is hosted with Netlify.

Have you reviewed this information?

1 Like

Hey @gregraven, thanks for the well thought out answer.

I’ve updated the DNS settings of www.albion.media to use Netlify’s DNS but the redirect still isn’t working. What am I doing wrong?

@alex.pan1021 Wow, you made a lot of changes to your DNS settings. I think what you need now is to edit the redirect command to:

https://www.albion.media/* https://www.tryjraft.com/:splat 301!

per:

2 Likes

Hi, @alex.pan1021. It seems that you have implemented @gregraven’s most recent recommendation as it is working when I test now:

$ curl -svo /dev/null https://www.albion.media/foo  2>&1 | grep "< location"
< location: https://www.tryjraft.com/foo

If there are other questions about this, please let us know.

1 Like

@gregraven

Thank you so much, that has fixed my problem! Legend

Thanks @luke for following up on this

1 Like