基于具有友好 url 的查询字符串的动态页面
本质上我想做的是有几个页面充当数据模板。
如果 url 是 www.site.com/home,我想查询“/home”的友好 url 字段,它将返回
- pageurl (/template1.aspx)
- pageId (1)
www.site.com/home 将是 www.site.com/template1.aspx?pageId=1
www.site.com/about 将是 www.site.com/template2.aspx?pageid=4
或者有什么更好的方法建议吗?
编辑:
另外,输入 www.site.com/template1.aspx?pageId=1 应该将 url 路由到 www.site.com/home
Essentially what I want to do is have a few pages that act as templates for data.
If a url is www.site.com/home, I want to query a friendly url field for "/home" which would return
- pageurl (/template1.aspx)
- pageId (1)
www.site.com/home would be www.site.com/template1.aspx?pageId=1
www.site.com/about would be www.site.com/template2.aspx?pageid=4
Or any suggestions on a better method to do this?
Edit:
Also, typing www.site.com/template1.aspx?pageId=1 should route url to www.site.com/home
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您只需要一个 URL 重写引擎。您可以构建自己的、免费下载一些或购买一些。以下是一些:
You just need a URL rewriting engine. You can build your own, download some for free or buy some. Here's a few: