Forum Moderators: open

Message Too Old, No Replies

Web Config file redirect issue

Web Config file redirect issue

         

Marshall

11:18 am on Jun 8, 2025 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



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.

lucy24

4:46 pm on Jun 8, 2025 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Have you tried escaping the parentheses? That would be my first guess. (My background of course is Apache, but some things must be universal.)
"Old_Page_\(sometext\)"

And I am confident you have learned from this not to use anything but alphanumerics from here on ;)

Marshall

9:38 pm on Jun 8, 2025 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



No I have not and I was not the one who created the URL in the first place.

Marshall

3:28 am on Jun 9, 2025 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Lucy, the backslash work. I never had, or seen, a parenthesis in a URL before. Learn new things every day. Thanks.

lucy24

3:21 pm on Jun 9, 2025 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I never had, or seen, a parenthesis in a URL before
I associate them with wikipedia.

tangor

2:33 am on Jun 10, 2025 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Gotta love regex ... some things ARE universal!