# Custom route ignore few url from discourse

**URL:** <https://meta.discourse.org/t/custom-route-ignore-few-url-from-discourse/283405>\
**Category:** Development\
**Created:** [October 25, 2023, 12:57pm UTC](https://meta.discourse.org/t/custom-route-ignore-few-url-from-discourse/283405 "2023-10-25T12:57:08Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Hitesh\_Sharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hitesh_sharma/32/309992_2.png) [@Hitesh\_Sharma](https://meta.discourse.org/u/Hitesh_Sharma)\
**Post date:** [October 25, 2023, 12:57pm UTC](https://meta.discourse.org/t/custom-route-ignore-few-url-from-discourse/283405/1 "2023-10-25T12:57:08Z")

</div>

Hi,

I am trying to ignore specific URLs on this custom route using the code below.  
(routes.rb files)

`get '/*path' => 'static#custom_redirect', constraints: lambda { |request| !request.path.include?('/preferences/' ) || !request.path.include?('/custom_sso_login/') || !request.path.include?('/t/' ) || !request.path.include?('/admin/') || !request.path.include?('/singup') || !request.path.include?('/login')}`

“It’s not working as expected. Do you have any experience dealing with this issue?”

---

_[View the full topic](https://meta.discourse.org/t/custom-route-ignore-few-url-from-discourse/283405)._
