By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,853 Members | 936 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,853 IT Pros & Developers. It's quick & easy.

URL Rewriting

P: n/a
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?
May 4 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On May 4, 1:57 pm, "Tony" <Tony...@gmail.comwrote:
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

May 4 '07 #2

P: n/a
On May 4, 2:02 pm, Alexey Smirnov <alexey.smir...@gmail.comwrote:
On May 4, 1:57 pm, "Tony" <Tony...@gmail.comwrote:


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- 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>

May 4 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.