# مشكلة في الروابط الدائمة، أم في regex؟

**URL:** <https://meta.discourse.org/t/problem-with-permalinks-or-regex/58686>\
**Category:** Product Support\
**Created:** [9 مارس 2017، 12:34ص UTC](https://meta.discourse.org/t/problem-with-permalinks-or-regex/58686 "2017-03-09T00:34:59Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [9 مارس 2017، 6:14م UTC](https://meta.discourse.org/t/problem-with-permalinks-or-regex/58686/7 "2017-03-09T18:14:26Z")

</div>

I meant after the replacement string. I have a `/` at the end of my RE (right?), but not the end of the replacement.

> [@Mittineague](#):
>
> I can’t help but wonder, do you actually have URLs that have “.html” towards the end,

I don’t know. Perhaps not. In other systems I’ve seen various cruft after the URL (as the example replacement suggests). I’m probably safe removing that last `.*` to be sure.

####To recap:

Normalization: `/forums\/f[0-9]+\/.+-([0-9])+\.html/oldlinks\/topics\/thread-\1`

- works: [http://localhost:3000/oldlinks/topics/thread-11769](http://localhost:3000/oldlinks/topics/thread-11769)
- no joy: [http://localhost:3000/forums/f38/a-bunch-of-words-11769.html](http://localhost:3000/forums/f38/a-bunch-of-words-11769.html)

I’ve checked the regex at [http://regexr.com/](http://regexr.com/) & it seems to work there. I’ve done something similar in the past. I’m stumped.

---

_[View the full topic](https://meta.discourse.org/t/problem-with-permalinks-or-regex/58686)._
