URL Rewriting

  • Thread starter Thread starter Tony
  • Start date Start date
T

Tony

I want to rewrite URL in asp.net 2.0 but I can't. I wrote this in web config
file:

<urlrewrites>
<rule>
<url>/urlrewriter/show\.asp</url>
<rewrite>show.aspx</rewrite>
</rule>
<rule>
<url>/urlrewriter/wohs\.asp</url>
<rewrite>show.aspx</rewrite>
</rule>
<rule>
<url>/urlrewriter/show(.*)\.asp</url>
<rewrite>show.aspx?$1</rewrite>
</rule>
<rule>
<url>/urlrewriter/(.*)show\.html</url>
<rewrite>show.aspx?id=$1&amp;cat=2</rewrite>
</rule>
<rule>
<url>/urlrewriter/s/h/o/w/(.*)\.html</url>
<rewrite>/urlrewriter/show.aspx?id=$1</rewrite>
</rule>
</urlrewrites>

But I got message: "Unrecognized configuration section
system.web/urlrewrites." How to fix it?
 
I want to rewrite URL in asp.net 2.0 but I can't. I wrote this in web config
file:

<urlrewrites>
<rule>
<url>/urlrewriter/show\.asp</url>
<rewrite>show.aspx</rewrite>
</rule>
<rule>
<url>/urlrewriter/wohs\.asp</url>
<rewrite>show.aspx</rewrite>
</rule>
<rule>
<url>/urlrewriter/show(.*)\.asp</url>
<rewrite>show.aspx?$1</rewrite>
</rule>
<rule>
<url>/urlrewriter/(.*)show\.html</url>
<rewrite>show.aspx?id=$1&amp;cat=2</rewrite>
</rule>
<rule>
<url>/urlrewriter/s/h/o/w/(.*)\.html</url>
<rewrite>/urlrewriter/show.aspx?id=$1</rewrite>
</rule>
</urlrewrites>

But I got message: "Unrecognized configuration section
system.web/urlrewrites." How to fix it?

Perhaps you did forget the code? :-)

http://www.codeproject.com/aspnet/urlrewriter.asp
 
Perhaps you did forget the code? :-)

http://www.codeproject.com/aspnet/urlrewriter.asp- Hide quoted text -

- Show quoted text -

I'm not sure if we are talking about the same code. But if you look at
the sample I've sent above, you'll see another section in the
web.config which you probably forgot to include....

<configSections>
<sectionGroup>
....
</sectionGroup>
</configSections>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top