# 301 redirect to another domain

**URL:** <https://forum.ghost.org/t/301-redirect-to-another-domain/24687>\
**Category:** Developer help\
**Created:** [August 4, 2021, 10:00am UTC](https://forum.ghost.org/t/301-redirect-to-another-domain/24687 "2021-08-04T10:00:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mane\_Saakyan](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mane_saakyan/32/11203_2.png) [@Mane\_Saakyan](https://forum.ghost.org/u/Mane_Saakyan)\
**Post date:** [August 4, 2021, 10:00am UTC](https://forum.ghost.org/t/301-redirect-to-another-domain/24687/1 "2021-08-04T10:00:44Z")

</div>

Hi guys,

I need to set yup 301 redirect from my ghost site [Ghost Admin](https://blog.wemaintain.com/ghost/#/site) to a site hosted elsewhere. Here’s the code I’m trying to upload in json. It doesn’t work :( Help please !

```json
[{
    "from": "http://blog.wemaintain.com/",
    "to": "https://www.wemaintain.com/fr/blog",
    "permanent": true
}]

```

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [August 4, 2021, 2:48pm UTC](https://forum.ghost.org/t/301-redirect-to-another-domain/24687/2 "2021-08-04T14:48:46Z")

</div>

Can you try making the `from` a relative path (`"from": "/"`) 🙂

---

<div class="post-metadata">

**Author:** ![Mane\_Saakyan](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mane_saakyan/32/11203_2.png) [@Mane\_Saakyan](https://forum.ghost.org/u/Mane_Saakyan)\
**Post date:** [August 4, 2021, 3:13pm UTC](https://forum.ghost.org/t/301-redirect-to-another-domain/24687/3 "2021-08-04T15:13:52Z")

</div>

> [@vikaspotluri123](#):
>
> "/

Oh wow, it worked! Thanks so much for your help, I spent 4 hours googling on this before posting here 😇

---

<div class="post-metadata">

**Author:** ![Mane\_Saakyan](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mane_saakyan/32/11203_2.png) [@Mane\_Saakyan](https://forum.ghost.org/u/Mane_Saakyan)\
**Post date:** [August 10, 2021, 2:48pm UTC](https://forum.ghost.org/t/301-redirect-to-another-domain/24687/4 "2021-08-10T14:48:56Z")

</div>

hey, I need a little bit more help 🙂

I need to set up 2 redirects:

1. domaine/en/text =\> first destination
2. domaine/tag/text =\> second destination

I’m trying to use regex for this, it works on regex101, but shows as error on my json file. What am I doing wrong? Do I actually need regex for this? Thanks so much !

```auto
{
    "from": "/^en\S*/gm",
    "to": "destination1",
    "permanent": true
}

```

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [August 11, 2021, 10:08pm UTC](https://forum.ghost.org/t/301-redirect-to-another-domain/24687/5 "2021-08-11T22:08:52Z")

</div>

Can you try this:

```auto
[{
	"from": "^\\/en/(.*)",
	"to": "destination1/$1"
}, {
	"from": "^\\/tag/*",
	"to": "destination2/$1"
}]

```
