---
title: "How do I handle slash on web.config rewrite"  
description: "How do I handle slash on web.config rewrite"  
author: "Anonymous User"  
published: 2015-01-14  
updated: 2015-01-14  
canonical: https://www.mindstick.com/forum/12858/how-do-i-handle-slash-on-web-config-rewrite  
category: "asp.net"  
tags: ["c#"]  
reading_time: 1 minute  

---

# How do I handle slash on web.config rewrite

How do I [handle](https://www.mindstick.com/articles/311004/suede-skillet-handle-cover) [product](https://www.mindstick.com/articles/75385/full-product-keys) id with slash.

Sample product id: PRODTSP/10

This [causes](https://yourviews.mindstick.com/view/293/renovation-causes-wastage-of-resources) a page error :

"The page [cannot be displayed](https://answers.mindstick.com/qa/95308/how-can-i-open-a-telegram-channel-that-cannot-be-displayed) because an [internal](https://www.mindstick.com/interview/773/describe-the-accessibility-modifier-protected-internal) [server](https://www.mindstick.com/articles/43769/what-is-serverless-architecture-is-it-worth-switching-over) error has occurred."

I also tried putting this escaped [string](https://www.mindstick.com/articles/1527/string-split-in-c-sharp) to URL, but still the error occurred: PRODTSP%2F10

This is my current [configuration](https://www.mindstick.com/articles/13112/setting-up-the-perfect-configuration-for-your-work-computer):

<rewrite url="^~/Product/id/([^/\\\'=]+)(/?)$" to="~/View/Product.aspx?id=$1"

[permanent](https://answers.mindstick.com/qa/50600/what-is-a-permanent-storage-in-pc)="true" [processing](https://www.mindstick.com/blog/254/background-processing-in-android)="stop"/>

Thank you

## Replies

### Reply by Anonymous User

```
<rewrite url="^~/Product/id/([^/\\\'=]+)/?$" to="~/View/Product.aspx?id=$1" permanent="true" processing="stop"/><rewrite url="^~/Product/id/([^\\\'=]+)/$" to="~/View/Product.aspx?id=$1" permanent="true" processing="stop"/><rewrite url="^~/Product/id/([^\\\'=]+)$" to="~/View/Product.aspx?id=$1" permanent="true" processing="stop"/>
```

**Please try to add this configuration to handle the error.**

- The first line is your original code.
- The second will handle slash inside the product id and also at the end of the URL.
- The last will handle slash inside the product id and without slash at the end of the URL.


---

Original Source: https://www.mindstick.com/forum/12858/how-do-i-handle-slash-on-web-config-rewrite

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
