在 cms 中制作用户友好的 url
我对 CMS 的架构很感兴趣,我可以在其中传递完整的 URL 而不是查询字符串。
我想建立一个可以处理任何页面请求的网站......说 'http://www.my-domain.com/directory/page.aspx' 并使生成的响应提供通用页面/文件。
我希望请求通过 XML 文档传递,我可以在其中存储页面名称和相应的文件来呈现内容...
我的具体问题
- 是这可能吗
- ?这很容易做到吗?
- 人们有任何链接吗? 他们可以与我分享的手 怎样的.
- 任何专业人士或 如果您可能遇到过缺点 都用过这个方法。
I am interested in the architecture of a CMS where i can pass a full URL instead of a query string.
I would like to make a site that could handle a request to any page... Say
'http://www.my-domain.com/directory/page.aspx'
and have the resulting response deliver a generic page/file.
I would like the request to be passed through an XML document where i could store page names and the corresponding file to render content...
My question specifically
- Is this possible
- Is it easy to do
- Are there any Links people have on
hand they could share with me on the
how to's. - Any pro's or
cons you may have come across if you
have used this method.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,这是可能的,而且相当简单。大多数 CMS 都是这样做的,但使用数据库而不是 XML 文件。
您可能应该考虑一下 URL 重写。这个概念是将 URL 结构与实际文件系统表示分离。
对于.NET: UrlRewriting.Net 是一个宝石。
然而,由于像您所描述的那样,已经有数百个出色的 CMS,我建议使用其中之一并节省您的工作量。提供更详细的要求,我可以提出一个建议。
Yes, it's possible, and reasonable easy. Most CMSes do it this way, but use a database instead of an XML file.
You should probably look into URL rewriting. The concept is to separate the URL structure from the actual filesystem representation.
For .NET: UrlRewriting.Net is a gem.
However, since there are hundreds of fantastic CMSes already out there like you describe, I'd suggest using one of them and saving yourself work. Provide more detailed requirements and I can suggest one.