Using Netlify for Dynamic URL Redirects
+Using Netlify for Dynamic URL Redirects
+2021-12-03
-With the recent domain switch that took place on this website, I needed to have a dependable setup to forward my old domain URLs to the new one. While using something like "URL forwarding" through your domain provider could work, it doesn't natively support dynamic linking. Let me explain using a basic example:
+ +With the recent domain switch that took place on this website, I needed to have a dependable setup to forward my old domain URLs to the new one. While using something like “URL forwarding” through your domain provider could work, it doesn’t natively support dynamic linking. Let me explain using a basic example:
+-
-
- A user clicks on a link that targets a post on your old domain:
olddomain.com/random-post
- - You want that link to forward using the same permalink structure:
newdomain.com/random-post
- - "URL forwarding" through your domain provider does not support this +
- A user clicks on a link that targets a post on your old domain:
olddomain.com/random-post
+ - You want that link to forward using the same permalink structure:
newdomain.com/random-post
+ - “URL forwarding” through your domain provider does not support this
Simple stuff. So, let's breakdown how to easily set this up on Netlify for free.
-Setting Up Netlify
+ +Simple stuff. So, let’s breakdown how to easily set this up on Netlify for free.
+ +Setting Up Netlify
+-
-
- Create an account (or login to an existing one) and setup a new site[^1] -
- Change your "old" domain name nameservers to match Netlify's (normally done through your domain register) +
Create an account (or login to an existing one) and setup a new site[^1]
+Change your “old” domain name nameservers to match Netlify’s (normally done through your domain register) +
dns1.p03.nsone.net
dns2.p03.nsone.net
dns3.p03.nsone.net
dns4.p03.nsone.net
+