Url routing with database lookup?

后端 未结 4 679
孤街浪徒
孤街浪徒 2021-01-06 12:25

I want to build a ASP.NET MVC site so that the controller for a specific url is stored in the database instead of the URL.

The reason for that is that i\'m building

4条回答
  •  渐次进展
    2021-01-06 13:24

    I suppose ASP.NET can do many of the same things as PHP. If so there is a simple approach.

    With rewrite rules you can easily send any traffic to any URL of the 100K to the same place. On that destination you could simply use the server variables containing the URL requested by the client and extract the location. Look it up in the DB and send the corresponding data for that URL back to the client on-the-fly.

提交回复
热议问题