0

I want paths like this:

localhost:99/client/themes/plain/index.html?shop=mycoolshop

to appear as:

localhost:99/client/mycoolshop/index.html.

I wrote:

  routes.MapPageRoute(
            routeName: "Client",
            routeUrl: "client/{shopname}/{page}",
            physicalFile: "~/client/themes/plain/{page}?Shop={shopname}"
       );

But to no luck. When I type localhost:99/client/mycoolshop/index.html it says page not found. What am I doing wrong?

Mark J. Bobak
  • 13,720
  • 6
  • 39
  • 67
user2645830
  • 362
  • 1
  • 6
  • 22

2 Answers2

0

I think you may be looking for URL Rewriting rather than WebAPI routing. Take a look at this SO thread

Community
  • 1
  • 1
LB2
  • 4,802
  • 19
  • 35
0

You can use this setting in the system.web section of your web.config:

<httpRuntime relaxedUrlToFileSystemMapping="true" />

Here's a more detailed explanation of how this works.

elolos
  • 4,310
  • 2
  • 28
  • 40