# Come posso aggiungere reindirizzamenti 301 personalizzati dopo un'importazione phpBB?

**URL:** https://meta.discourse.org/t/how-can-i-add-custom-301-redirections-after-a-phpbb-import/90556
**Category:** Support
**Created:** [23 Giugno 2018, 7:02pm UTC](https://meta.discourse.org/t/how-can-i-add-custom-301-redirections-after-a-phpbb-import/90556 "2018-06-23T19:02:36Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [23 Giugno 2018, 7:02pm UTC](https://meta.discourse.org/t/how-can-i-add-custom-301-redirections-after-a-phpbb-import/90556/1 "2018-06-23T19:02:36Z")

</div>

Hi.  
I’ve imported a phpbb forum to Discourse.  
After the import, I’ve merged a lot of categories. I would like to redirect the old phpbb links to this new category.

How can I add such 301 redirections in Discourse?

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [23 Giugno 2018, 7:40pm UTC](https://meta.discourse.org/t/how-can-i-add-custom-301-redirections-after-a-phpbb-import/90556/2 "2018-06-23T19:40:21Z")

</div>

Well I should search more than 5 min before starting a topic I guess.

> [@Redirect old forum URLs to new Discourse URLs using permalinks](https://meta.discourse.org/t/redirecting-old-forum-urls-to-new-discourse-urls/20930):
>
> Redirecting Old Forum URLs to New Discourse URLs using permalinks If you’ve moved from other forum software to Discourse using [one of our import scripts](https://github.com/discourse/discourse/tree/main/script/import_scripts), then you probably want all your hard-earned Google search results to continue pointing to the same content. Discourse has a built-in way to handle this for you as an alternative to writing nginx rules, using the permalinks lookup table. The permalinks table allows you to set two things: a url to match, and what that url should show. There a…

edit : well my questions is now more like “How can I edit a redirection”, since there are actually already redirections:

```plaintext
[1] pry(main)> Permalink.create(url: '/viewforum.php?f=15', category_id: 80)
ActiveRecord::RecordNotUnique: PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_permalinks_on_url"
DETAIL: Key (url)=(viewforum.php?f=15) already exists.
: INSERT INTO "permalinks" ("url", "category_id", "created_at", "updated_at") VALUES ('viewforum.php?f=15', 80, '2018-06-23 19:48:22.967909', '2018-06-23 19:48:22.967909') RETURNING "id"
from /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-mini-profiler-1.0.0/lib/patches/db/pg.rb:92:in `async_exec'

```

The redirection is wrong though, I need to change the target. Any idea?

edit : okay, go to the “customize” admin section. \o/

---

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [25 Giugno 2018, 3:00pm UTC](https://meta.discourse.org/t/how-can-i-add-custom-301-redirections-after-a-phpbb-import/90556/3 "2018-06-25T15:00:53Z")

</div>


