<p>When building a site locally and linking to entries in redactor fields, all of the links are being saved in the database with links to my local dev server (<a href="http://mysite.test/path/" rel="nofollow noreferrer">http://mysite.test/path/</a>). Is there a config setting or any way to have these links be dynamic and use the {siteUrl} path instead of being hard-coded to the dev url?</p>

CC BY-SA 3.0
2018-03-09T20:19:00.900Z
Did you insert the links as they are (just copy paste them) do you use a redactor function in order to store them?
Robin Schambach
CC BY-SA 3.0
2018-03-09T22:54:12.587Z
I'm using the redactor 'link to an entry' function.
artmem
CC BY-SA 3.0
2018-03-10T08:40:58.737Z
You could create a twig filter and use a regex to replace old urls with new urls. Or you can (only one time initially) fetch all entries, replace the links and re-save them. The proper way would be to use reference tags `[link text]({entry:20})` or relation fields
Robin Schambach
<redactor>
Redactor entry links to dev server
# Redactor entry links to dev server

(Asked by: username_0 on 2018-03-09)

When building a site locally and linking to entries in redactor fields, all of the links are being saved in the database with links to my local dev server (<http://mysite.test/path/>). Is there a config setting or any way to have these links be dynamic and use the {siteUrl} path instead of being hard-coded to the dev url?

**Tags:** redactor
> **Comments:**
> **username_1**: Did you insert the links as they are (just copy paste them) do you use a redactor function in order to store them?  
> **username_0**: I'm using the redactor 'link to an entry' function.  
> **username_1**: You could create a twig filter and use a regex to replace old urls with new urls. Or you can (only one time initially) fetch all entries, replace the links and re-save them. The proper way would be to use reference tags `[link text]({entry:20})` or relation fields  

---

## 0 answers

