Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
Forum Search
Google Site Search
 All Forums
 Technical
 ASP (Windows server) versions
 Web Config file redirect issue
Author    Topic »  

Marshall
Ecommerce Template Guru

USA
1920 Posts

Posted - 06/08/2025 :  04:19:32  
Having issues redirecting an old URL that has parenthesis in it to a new URL. Have both of these in web.config and neither work.

<rule name="page1" stopProcessing="true">
<match url="Old_Page_(sometext)" />
<action type="Redirect" url="thewebsite/The-New-Page" />
</rule>
<rule name="page12" stopProcessing="true">
<match url="Old_Page_%28sometext%29" />
<action type="Redirect" url="thewebsite/The-New-Page" />
</rule>

I know %28 and %29 appear in the URL in the browser, but neither redirect works and it just ends up on the 404 page. I researched it, but could not find anything useful. All the other redirects, those without special characters, work fine.

Any help would be appreciated.


Marshall
CENLYT Productions - ms designs
Affordable Web Design
Custom Ecommerce Designs
Responsive Websites
Cenlyt.com

dbdave
ECT Moderator

USA
10514 Posts

Posted - 06/08/2025 :  15:39:53  
Hi Marshall, you would need to escape the parenthesis

To redirect a URL in IIS that contains parentheses, you need to escape them in your redirection rule. Replace ( with \( and ) with \). This ensures that the parentheses are treated literally in the URL pattern matching,

Have you tried that?

Thanks,
David

Marshall
Ecommerce Template Guru

USA
1920 Posts

Posted - 06/08/2025 :  20:26:08  
I just did based on what you said and it worked like a charm. Never had a parenthesis in a URL before. Thanks Dave.

Marshall
CENLYT Productions - ms designs
Affordable Web Design
Custom Ecommerce Designs
Responsive Websites
Cenlyt.com

dbdave
ECT Moderator

USA
10514 Posts

Posted - 06/08/2025 :  21:02:58  
     Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.03 seconds. Snitz Forums 2000