Hi there, I was using a custom domain with my netlify.app website and now I want to redirect that custom domain to another custom domain, kindly tell me how to do it.
If you own the domain https://www.gamingtechreviewer.com and then you have linked it to https://gamingtechreviewer.netlify.app, you can follow the steps below for creating a redirect.
In your project root folder for the site https://gamingtechreviewer.netlify.app, kindly create a netlify.toml file and then use the code below for the redirect. Replace https://your_domain.com with https://www.pctechreviewer.com. After you are done kindly redeploy for the changes to take effect.
[[redirects]]
from = "/*"
to = "https://your_domain.com"
status = 301
force = true
Let me know if it works and you are able to redirect. Thanks.
Hope this helps.
If both domains are connected to gamingtechreviewer.netlify.app(I’m assuming they are) the redirect from Clarence won’t work as it would redirect traffic to any domain. You only want to redirect a specific domain such as
[redirects]
from = "https://www.gamingtechreviewer.com/*"
to = "https://www.pctechreviewer.com/:splat"
status = 301
force = true
I have included a splat so that https://www.gamingtechreviewer.com/some/path will redirect to https://www.pctechreviewer.com/some/path.
You could also use _redirects instead of a netlify.toml
Actually I want to migrate the domain A which is the gamingtechreviewer and all its content to pctechreviewer, so first I need to set the 301 redirect. Now kindly tell me the process?
But nothing happened, why doesn’t the redirection worked ? Same site is opening on both different URL’s why doesn’t the redirection worked? See yourself by visiting the both URL’s
Based on your initial comment you indicated you wanted gamingtechreviewer.com as primary domain.
From the image you shared pctechreviewer.com is your primary domain.
However if you want pctechreviewer.com as your primary domain and then gamingtechreviewer.com to redirect to pctechreviewer.com, kindly add the alias gamingtechreviewer.com without the www at the beginning and then modify your redirects file to match the code below.
[[redirects]]
from = "https://gamingtechreviewer.com/*"
to = "https://www.pctechreviewer.com/:splat"
status = 301
force = true
[[redirects]]
from = "https://www.gamingtechreviewer.com/*"
to = "https://www.pctechreviewer.com/:splat"
status = 301
force = true