views:

60

answers:

2

I am looking to rewrite all ASP.NET pages to a uniform structure. Something like:

  • /Content1/Page1.aspx -> /Page1

  • /Content1/Page2.aspx -> /Page2

  • /Content2/Page3.aspx -> /Page3 (note different sub-dir)

  • /xyz/Page4.aspx -> /Page4

Is this possible?


URL Rewriting seems interesting... Will it also comply with my web.config security rules (ie. address access only to /Content2/Page5.aspx should remain in force when browsing to /Page5).

A: 

Have you looked into URLRewriting? I suppose you could do it with URLRouting as well, but I'll let someone else answer that route.

EDIT:

Another option is that if you know the EXACT file path for each file, you can hard code each path using URLMappings

rockinthesixstring
A: 

If you're using IIS 7+, you can use the IIS URL Rewrite Module from Microsoft (link).

If you're using IIS 6, take a look at ISAPI Rewrite. I used it a little and it seemed to work pretty well.

David Hoerster