# Permalink para search.php não redirecionando para /search

**URL:** <https://meta.discourse.org/t/permalink-to-search-php-failing-to-redirect-to-search/73158>\
**Category:** Product Support\
**Created:** [31 Outubro , 2017 17:42 UTC](https://meta.discourse.org/t/permalink-to-search-php-failing-to-redirect-to-search/73158 "2017-10-31T17:42:17Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![xrav3nz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/xrav3nz/32/76894_2.png) [@xrav3nz](https://meta.discourse.org/u/xrav3nz)\
**Post date:** [31 Outubro , 2017 19:29 UTC](https://meta.discourse.org/t/permalink-to-search-php-failing-to-redirect-to-search/73158/2 "2017-10-31T19:29:07Z")

</div>

> [@smaffulli](#):
>
> shows that the permalink is somewhat processed by SearchController: is that correct?

I’m afraid so, since there is already a Discourse(Rails) route named `/search`: it hits the `SearchController` before it can be processed by the `PermalinkController`.

The `.php` part is considered (mistaken) as the desired response format, thus the 406.

> [@smaffulli](#):
>
> Any suggestion on how to properly redirect requests from /search.php to /search?

There could be better solutions, but I think you’ll have to handle the redirect on NGINX, before it gets to Discourse:

> **[F5 NGINX: Built for cloud-native apps. Ready for AI traffic.](https://www.f5.com/products/nginx)**

Maybe something along the lines of: (not tested)

```nginx
location = /search.php {
  return 301 /search?$args;
}

```

---

_[View the full topic](https://meta.discourse.org/t/permalink-to-search-php-failing-to-redirect-to-search/73158)._
