在 cms 中制作用户友好的 url

发布于 2024-08-16 18:46:24 字数 434 浏览 7 评论 0原文

我对 CMS 的架构很感兴趣,我可以在其中传递完整的 URL 而不是查询字符串。

我想建立一个可以处理任何页面请求的网站......说 'http://www.my-domain.com/directory/page.aspx' 并使生成的响应提供通用页面/文件。

我希望请求通过 XML 文档传递,我可以在其中存储页面名称和相应的文件来呈现内容...

我的具体问题

  1. 是这可能吗
  2. ?这很容易做到吗?
  3. 人们有任何链接吗? 他们可以与我分享的手 怎样的.
  4. 任何专业人士或 如果您可能遇到过缺点 都用过这个方法。

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

  1. Is this possible
  2. Is it easy to do
  3. Are there any Links people have on
    hand they could share with me on the
    how to's.
  4. Any pro's or
    cons you may have come across if you
    have used this method.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

狼性发作 2024-08-23 18:46:24

是的,这是可能的,而且相当简单。大多数 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文