Need help with redirecting

PLEASE help us help you by writing a good post!


I have DNS Setup on a domain I bought from GoDaddy -

I need help with redirecting to

I tried doing it using _redirects in the bitbucket repository but it did not work.

How can I go ahead and do this and what exatcly do I need to write to have the URL redirecting.


Hi, @Ronny. No redirects are being detected:

Please make sure to put the _redirects file in the publish directory and not the build directory. If that is done and they still don’t work, please let us know.

Hi @luke,

Thank you for the reply. Really appreciate it.

I removed the _redirects when I added the message.

I have added _redirects file to the repository.

I attached a screenshot of the code I added to the _redirects file.

Hope to hear from you soon.


Hi, @Ronny, the redirects are working now when I test:

$ curl -svo /dev/null  2>&1 | egrep -i '< (http|location)'
< HTTP/2 301
< location:

That redirects because there is no page/file at the path /foo. This would not redirect if one of these two files exists in the deploy:

  • /foo.html
  • /foo/index.html

If one of those file did exist, the URL would not redirect because the rule isn’t “forced”.

If you want a redirect to apply even when the page/file does exist, then make it a “forced” rule adding a “!” to the status (by specifying 301 the status code was blank). (301 is the default. All other status codes must be defined.) For example:

/   301!

This would force the redirect even though there is a file at /index.html.

Also, do you want to do a 301 redirect or a 200 status to proxy? If you use a 200, Netlify will proxy if the files/pages don’t exist at Netlify. Again, you can also use a 200! forced rule to always proxy.

For example:

/          200!
/*    200!

This would never show any deployed files at Netlify and alway proxy the site to the content hosted at the second URL.

Also, if you want the domain itself to point to Netlify, there is external DNS and Netlify DNS. I recommend starting with external first DNS if you are just testing.

I’m not recommending any particular solution above, just showing what is possible. There is more about redirect options in our documentation here. ​Please let us know if there are other questions about any of this.

Hi @luke,

I just updated the _redirects file and added 301! at the end of all three lines.

But the page now goes to my portfolio link instead of

How can I redirect it to the url I want.

Also N.B. there was nothing in /projects/paypal-comparison-solutions/


Hello @Ronny, it looks like you have the following rule on the site you are redirecting to:
“/*”. This redirects all paths to the root. You’ll want to add a splat, like “/*” so that the path is preserved. Let me know if that helps.

Hi @Dennis,

I updated _redirects on my portfolio.

So nows that preserved. So when I click on the url now on netlify it redirects.

But now I am getting the error message -

" This page isn’t working redirected you too many times. "

What do I need to do next in order for it to display the page on the redirect?


This rule will create an infinitely loop of redirects:


This is because the rule exists on this the site with this subdomain. It is being redirected back to itself.

So, if you put this rule on this, then this URL:

would then be redirected to this URL:

However, this rule is on this site ( not a different site. So this rule redirects this URL:

to this UR:

They are the same URL. This is an infinite redirect.

Would you please give real world examples of a starting URL and what URL that starting URL should redirect to? For example:

This starting URL:

Should redirect to this URL:

Note, this redirect above is already working. It is just that there is also a rule at the site which then creates an infinite loop.

Finally, there is the issue that there is no page at /projects/paypal-comparison-solutions/ on the site. Even if the infinite loop wasn’t happening, there will still be a 404 not found after the 301 redirect. I’d expect the redirect to target a URL which isn’t a 404.

Are you trying to display a third site at the URL? If so, what third site should be shown there?

Hi @luke,

So based off your recommendations above I removed the _redirects file in my portfolio link

I have added the code in the _redirects file for my paypal repository.

On my repository linked to this URL - I added an index.html in the following path /projects/paypal-comparison-solutions directory.

I have updated the _redirects file on

But its not redirecting to

Could you tell me what I am doing wrong.


Hey Ronny,

I’ve just clicked and been taken straight to Can you confirm that this is the case for you?

Hi @luke @Dennis @Pie,

Thank for your support with fixing this issue.

I was able to fix this.

I added a sub domain to the files which fixed the issue.