Need to redirect custom domain netlify

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.

Site: https://gamingtechreviewer.netlify.app/
Custom domain (Primary Domain): https://www.gamingtechreviewer.com/
Now I want to redirect the primary domain to : https://www.pctechreviewer.com/

Neeed Guidance…

Hello @mohammadumermalik42 , thanks for posting.

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.

Hey @mohammadumermalik42

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

https://www.gamingtechreviewer.com/*    https://www.pctechreviewer.com/:splat    301!
1 Like

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?

Check Screenshots: https://ibb.co/BqM3b9y
https://ibb.co/PN0DsbWa

Now Can you tell me how to redirect,…

Please Check Screenshots: https://ibb.co/BqM3b9y
https://ibb.co/PN0DsbWa

Now Can you tell me how to redirect,…

Hello @mohammadumermalik42 , thanks for the extra information.

If both domains are connected to gamingtechreviewer.netlify.app (I’m assuming they are)

If you want to migrate all the contents, you can point both domains to the deployed site https://gamingtechreviewer.netlify.app and then follow @coelmay’s redirect suggestion.

If you have not linked both domains to gamingtechreviewer.netlify.app, kindly visit the link below.

Also let me know if the suggestion above works.

Check screenshot: 3333 — ImgBB

I have made my primary domain as “https://www.pctechreviewer.com” and made an alias domain "https://www.gamingtechreviewer.com/ But also added this code in the netlify.toml file as mentioned above:

[redirects]
from = “https://www.gamingtechreviewer.com/*”
to = “https://www.pctechreviewer.com/:splat
status = 301
force = true

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

hello @mohammadumermalik42 , thanks for the extra feedback.

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

Let me know if it works.