# URL Redirection problem

**URL:** <https://answers.netlify.com/t/url-redirection-problem/39898>\
**Category:** Support\
**Tags:** redirects, netlify-newbie\
**Created:** [June 25, 2021, 5:13am UTC](https://answers.netlify.com/t/url-redirection-problem/39898 "2021-06-25T05:13:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![yoshisam1](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/yoshisam1/32/26847_2.png) [@yoshisam1](https://answers.netlify.com/u/yoshisam1)\
**Post date:** [June 25, 2021, 5:13am UTC](https://answers.netlify.com/t/url-redirection-problem/39898/1 "2021-06-25T05:13:32Z")

</div>

Hi all, I just started learning netlify and is following a YT tutorial, however in the section of redirecting I faced a difficult issue, read the netlify articles and tried but still no fruit. As of right now I am only using developer mode but set it to ‘–live’ so everyone can observe.

The test server: [https://firstapppermit-f86897.netlify.live/](https://firstapppermit-f86897.netlify.live/)

The Issue is described below:

I am trying to demonstrate redirection using the ‘\_redirects’ file, which content is written below:

```auto
/home /
/living /die
/cuties https://www.petsofnetlify.com 301!

```

The first two redirects (which redirects to internal server) works fine with no issue, however each time i tried to use a URL to redirect to external website (tried LinkedIn, Instagram, finally petsofnetify) it always returns back to ‘/’ (index.html). I am very confused on whats wrong with just a simple redirect, the YT tutorial i’m following has absolutely no issue doing this. Requesting support and advise, thankyou.

My netlify.toml file:

```auto
[build]
    base="dist/"
    publish="dist/"

```

My project directory setup:

 ![Screen Shot 2021-06-25 at 12.03.14](https://global.discourse-cdn.com/netlify/original/3X/e/b/eb1db262243764b1459ab0564283bc73b2b597a6.png)

Observations:  
adding ‘/’ before https…etc makes it redirect to /[https://www.petsofnetlify.com](https://www.petsofnetlify.com) (i know it will just say page not found but thats not the point) which means the rule is recognized by netlify

Attempts tried:  
Using ‘200’ which ends up making a proxy in the same address (i dont want this)  
Turning on/off pretty URL  
using/not suing ‘301’ at the end of the line

---

<div class="post-metadata">

**Author:** ![coelmay](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/coelmay/32/24427_2.png) [@coelmay](https://answers.netlify.com/u/coelmay)\
**Post date:** [June 25, 2021, 6:05am UTC](https://answers.netlify.com/t/url-redirection-problem/39898/2 "2021-06-25T06:05:09Z")

</div>

Hi @yoshisam1

Welcome to the Netlify community.

Are you testing this on your local machine? If so have a look here

> [@Localhost redirect](https://answers.netlify.com/t/localhost-redirect/39365):
>
> Hello everyone! Okay tl;dr – I’m trying to setup a 301 redirect from [http://localhost](http://localhost) to [http://dev.localhost](http://dev.localhost), but when I tell that to netlify.toml, it seems to instead redirect me to /, which results in a redirect loop. Full story: In order to get around an issue using magic.link with Brave, I need to access my dev site (which I start with netlify dev) at the domain http://dev.localhost instead of http://localhost. (Brave seems to resolve anything \*.localhost to 127.0.0.1, which makes things…

---

<div class="post-metadata">

**Author:** ![yoshisam1](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/yoshisam1/32/26847_2.png) [@yoshisam1](https://answers.netlify.com/u/yoshisam1)\
**Post date:** [June 25, 2021, 7:01am UTC](https://answers.netlify.com/t/url-redirection-problem/39898/3 "2021-06-25T07:01:45Z")

</div>

yes I am testing it on my local machine, and reading the thread you gave me it seems that I have similar issues, that it redirects me back to ‘/’ instead of the URL…the thread doesn’t seem to be resolved though.

---

<div class="post-metadata">

**Author:** ![coelmay](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/coelmay/32/24427_2.png) [@coelmay](https://answers.netlify.com/u/coelmay)\
**Post date:** [June 25, 2021, 7:22am UTC](https://answers.netlify.com/t/url-redirection-problem/39898/4 "2021-06-25T07:22:48Z")

</div>

At this stage it isn’t resolved.

You could lock your deploys then push a new deploy as a preview so you can test things without them going live. Do so myself regularly.

---

<div class="post-metadata">

**Author:** ![yoshisam1](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/yoshisam1/32/26847_2.png) [@yoshisam1](https://answers.netlify.com/u/yoshisam1)\
**Post date:** [June 25, 2021, 7:24am UTC](https://answers.netlify.com/t/url-redirection-problem/39898/5 "2021-06-25T07:24:03Z")

</div>

i see, alright, i will try that. Thankyou!
