URL REDIRECT for Domain name

Hi, how can I set the URL reditect to another domain name where is hosted the website?

Thank you

An example of exactly what you are trying to do would be nice.

Without that, you can set up a redirect in your _redirects or netlify.toml file, or you can create a “stub” file that is a stripped-down HTML file that contains the bare minimum for a valid HTML file, plus a meta refresh command – the refresh being the redirect.

<meta http-equiv=“refresh” content=“0;url=https://example.com/” />

hi there,
I think that the docs on redirects is a great place to start:

Hi thank you!
Anyway I have no hosting fot the domain name on Netfly, so where can I witre the redirect instruction?
Can I use the dnd panel? Usually there it a setting URL for the redirect, but I can’t find it.

Is this correct?

[[redirects]]
from = “https://somenetlifysite.netlify.com
to = “https://mycustomdomain.com
status = 301
force = true
Thank you

Hi, @Andre76bo, the example above is correct:

 [[redirects]]
  from = “https://somenetlifysite.netlify.com”
  to = “https://mycustomdomain.com”
  status = 301
  force = true

The syntax above is for a netlify.toml file. There is a different syntax if the file used is _redirects instead.

We are happy to check to see if the build system is finding and creating these redirect rules. If not, we will hopefully be able to determine why not and how to resolve it.

Which Netlify site is this for (so we can research what is happening)?

Hi, thank you…I’m completely lost!! I can’t understand how and where to put this netlifly.toml file!
Is there a siple redirect setting by URL in the dns config?
This is the website: airbnbbologna.com
I made an app on github but I can’t understand how to have a web hosting for the file. :frowning:

Thank you

It looks like you have a Github account. Do you have a Netlify account yet? If not, you can create one by going here and logging in with your Github credentials:
https://app.netlify.com/

From there, you can either link an existing Github repo to your new Netlify account or click the “New site from Git” button. That will get your code deployed on Netlify at the automatically generated Netlify site name that you get when you first create the site.

The next steps are to set up your custom domain. To do that, you’ll go to https://app.netlify.com/sites/SITE-NAME/settings/domain#domains

…but replace SITE-NAME with that automatically generated name you got above. At this point, your netlify.toml file may become more helpful. You’ll want to put it in the root of the published directory, so you’ll push it to Github and then Netlify will pick up the updated files from there. The link that @perry referenced above is a great resource- do you want to give this a shot and let us know how it goes?

Hi Jen, thank you so much. The problem is that I can’t get how to create a new site.

I have the account on netlfy because I registered a domain name that I want to redirect to another domain name with a site (that is not on Github.

Thank you

Well - is that prova repo having any content on the master branch?

Hi!

No there’s no content even because I can’t understand how to configure the master branch :frowning:

Thank you

hi @Andre76bo - this tutorial is a little older but should take you through the steps to publish a site on Netlify!

here is another:

are these examples helpful at all?

Great, thank you!!
I’m trying on it! :smiley:
And let you know if works for me.

Hi! I’ve tried to upload the netlify.toml file the the main folder of the website but sure I can’t get how to do properly.
Please can you check and give me some more info? Where the file have to be put?
Is that file enough to redirect?

Thaank you

!

Hi, @Andre76bo. There isn’t a way to add a single file to an existing deploy. If you want to add that file to your Netlify site, then the entire deploy will need to be completed again, this time with that file added.

If you are using the Drag and Drop method, then copy/move that file to the base directory being uploaded and then upload the entire directory tree again.

If that doesn’t work and/or if there are any other questions, please let us know.

Hi, I’ve tried, but still have errors. I attach you so maybe you can help me!
Thank you!

hi @Andre76bo, it looks like you have some kind of error in your netlify.toml and that is why your site isn’t building.

Can you post the contents of that file here please?

Hi, the file is named netlify.toml anche this is the content:

[[redirects]]
  from = "https://airbnbbologna.com”
  to = "https://www.bnbbologna.it”
  status = 301
  force = true

Thank you so much for your help!