regex - URL routing process works on one web, not another. 100% processor usage -


i thought have url routing under control works on 1 website found out not working fine on another. both websites run same server, same iis 6.0, same asp_isapi.dll.

setup 1: 1 works well:

            routes.mappageroute("article seo",                         "sid/{sid}",                         "~/ar.aspx",                         true,                         new routevaluedictionary { },                         new routevaluedictionary { { "sid", @"^([a-za-z\-]*)+([a-za-z])+(.html)$" } }                      ); 

setup 2: one, similar not working well:

        routes.mappageroute("article",                         "page/{sid}",                         "~/page.aspx",                         true,                         new routevaluedictionary { },                         new routevaluedictionary { { "sid", @"^([a-za-z0-9\-]*)+([a-za-z0-9])+(.html)$" } }                     ); 

testing regex in regex coach shows written correctly, mean both catch or wrong strings.

url use second 1 http://address/page/some-html-keywords.html. if specify url works well.

problem if change .html extension .htmls or .anything kills web server. have 100% process usage. dont understand why , how, dont have problem first setup. can change whatever want , either shows page because have correct format or shows 404 page not found.

some examples:

http://address/page - 404 page, working correctly

http://address/page/test.html - accepted, working correctly

http://address/page/testing_#.html - 404 page, working correctly

http://address/page/test.htmls - wont show page, hanging, 100% process usage, not working correctly

http://address/page/test.whatever - wont show page, hanging, 100% process usage, not working correctly

http://address/page/page.aspx - redirects, working correctly

the same setup (with different regex check) works on other website within same iis 6.0. both use same asp_isapi.dll file.

i dont it. have tried comment code in page.aspx find out if there problem code within page.aspx doesnt matter. hangs empty page well. must problem url routing or isapi.dll or iis. other website on same iis , same machine works.

any opinions?

thank you

fero

i don't know url routing

but notice regular expression specify

@"^([a-za-z0-9\-]*)+([a-za-z0-9])+(.html)$" 

looks same in both code samples , (again, in both examples) ends trailing $ (which means end-of-string), prohibit not ending in .html being matched regular expression. .htmls need (.html.*)$, .anything need

@"^([a-za-z0-9\-]*)+([a-za-z0-9])+\.[a-za-z0-9]*$" 

also, idea esacpe '.' before html, \.html, reg expressions process '.' mean single character, includes '.' character.

i hope helps.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -