# Redirect appends slash

**URL:** <https://forum.ghost.org/t/redirect-appends-slash/7363>\
**Category:** Developer help\
**Created:** [May 18, 2019, 7:41pm UTC](https://forum.ghost.org/t/redirect-appends-slash/7363 "2019-05-18T19:41:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![b-m-f](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/b-m-f/32/3506_2.png) [@b-m-f](https://forum.ghost.org/u/b-m-f)\
**Post date:** [May 18, 2019, 7:41pm UTC](https://forum.ghost.org/t/redirect-appends-slash/7363/1 "2019-05-18T19:41:15Z")

</div>

Hello,

I am trying to set up a redirect.

At some point in the past my posts where at `/post/{slug}`. This has changed and they now just live at `/slug`. Since my blog is pointed to from some sources Id like to set up the correct redirects.

This is my rule to do this.

```auto
{"from":"^/post/(.*)/$","to":"/$1","permanent":true}

```

Unfortunately this results in [https://maximilianehlers.com/post/testable\_modules/](https://maximilianehlers.com/post/testable_modules/) being rewritten to [https://maximilianehlers.com/testable\_modules//](https://maximilianehlers.com/testable_modules//) .

Is there anything I am missing here to not have the second `/` appended?

Thanks for any help!

---

<div class="post-metadata">

**Author:** ![giacomosilli](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/giacomosilli/32/3403_2.png) [@giacomosilli](https://forum.ghost.org/u/giacomosilli)\
**Post date:** [May 19, 2019, 11:05am UTC](https://forum.ghost.org/t/redirect-appends-slash/7363/2 "2019-05-19T11:05:28Z")

</div>

This is how I redirect, they work properly:

To homepage:

```
{
    "permanent": false,
    "from": "^\\/tag/name(\\/?)$",
    "to": "/"
}

```

To other page:

```
{
    "permanent": false,
    "from": "^\\/tag/name(\\/?)$",
    "to": "/tag/name1/"
}
```

---

<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:** [May 19, 2019, 1:27pm UTC](https://forum.ghost.org/t/redirect-appends-slash/7363/3 "2019-05-19T13:27:05Z")

</div>

Ghost forces all URLs to have a trailing slash:

> <https://github.com/TryGhost/Ghost/issues/9189>
>
> The meta tag rel="canonical" on the home page has a trailing slash, though the b…log\_url is without trailing slash? How can this be removed?
> 
> The canonical url should be http://example.com instead http://example.com/ for SEO purposes.
> 
> I use the latest Ghost version.

So your redirects are working as intended, but the url `/testable_modules` gets redirected to `/testable_modules` elsewhere

---

<div class="post-metadata">

**Author:** ![b-m-f](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/b-m-f/32/3506_2.png) [@b-m-f](https://forum.ghost.org/u/b-m-f)\
**Post date:** [May 19, 2019, 5:02pm UTC](https://forum.ghost.org/t/redirect-appends-slash/7363/4 "2019-05-19T17:02:45Z")

</div>

hi @vikaspotluri123,

they almost work as intended. The problem I have is that 2 slashes are appended.

So instead of `https://maximilianehlers.com/testable_modules/` I end up with `https://maximilianehlers.com/testable_modules//`, which can not be found and then shows the 404 page.

---

<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:** [May 19, 2019, 5:06pm UTC](https://forum.ghost.org/t/redirect-appends-slash/7363/5 "2019-05-19T17:06:38Z")

</div>

Aah, the trailing slashes blended together 🤦‍♂️

Can you check the redirects in incognito? Everything seems to be working here 🤔

````auto
C:\>curl -I https://maximilianehlers.com/post/testable_modules/
HTTP/1.1 301 Moved Permanently
Cache-Control: public, max-age=31536000
Content-Length: 51
Content-Type: text/plain; charset=utf-8
Date: Sun, 19 May 2019 17:05:31 GMT
Location: /testable_modules
Vary: Accept, Accept-Encoding
X-Powered-By: Express

C:\>curl -I https://maximilianehlers.com/testable_modules
HTTP/1.1 301 Moved Permanently
Cache-Control: public, max-age=31536000
Content-Length: 52
Content-Type: text/plain; charset=utf-8
Date: Sun, 19 May 2019 17:05:48 GMT
Location: /testable_modules/
Vary: Accept, Accept-Encoding
X-Powered-By: Express

C:\>curl -I https://maximilianehlers.com/testable_modules/
HTTP/1.1 200 OK
Cache-Control: public, max-age=0
Content-Length: 11624
Content-Type: text/html; charset=utf-8
Date: Sun, 19 May 2019 17:06:02 GMT
Etag: W/"2d68-Lsr0d3WtmfA8PC2BlR2iQRfL0/I"
Vary: Accept-Encoding
X-Powered-By: Express```
````

---

<div class="post-metadata">

**Author:** ![b-m-f](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/b-m-f/32/3506_2.png) [@b-m-f](https://forum.ghost.org/u/b-m-f)\
**Post date:** [May 20, 2019, 8:22am UTC](https://forum.ghost.org/t/redirect-appends-slash/7363/6 "2019-05-20T08:22:51Z")

</div>

Oh wow! I thought I tried this. 😅

Thanks alot for trying this!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/b/ba9ce5100b8bb264586f4f572545596b2ce3f081.png) [@system](https://forum.ghost.org/u/system)\
**Post date:** [June 3, 2019, 8:26am UTC](https://forum.ghost.org/t/redirect-appends-slash/7363/7 "2019-06-03T08:26:19Z")

</div>

Closed on June 3, 2019, 8:26am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
