![](/img/trans.png)
[英]OpenCms : How to access xml element content from multiple schema files
[英]How to assign multiple url patterns to same container page in opencms
我想用不同的 url 模式调用特定的容器页面
www.abc.com/accounts/india-accounts/account-details?id=XXXXX
www.abc.com/accounts/india-accounts/account-details/xxxxx
这里的 account-details 是公共容器页面。 其中 xxxx 值每次都会更改。
我还没有找到办法做到这一点。 Opencms需要在db中有一个vfs资源被引用,如果你没有资源404被“抛出”。
有一些方法可以绕过它。
第二个解决方案是我在刚刚完成的项目中使用它来适应您的情况。
在 httpd 虚拟主机中:
RewriteCond %{REQUEST_URI} ^/accounts/india-accounts/account-details/.*$
RewriteRule ^/[^/]+/accounts/india-accounts/account-details/.*([^/]+)/?.*$ %{REQUEST_URI}?id=$1 [QSA]
RewriteCond %{REQUEST_URI} ^/accounts/india-accounts/account-details.*$
RewriteRule ^/accounts/india-accounts/account-details.*$ /opencms/opencms/accounts/india-accounts/account-details [PT,QSA]
希望能帮助到你
你究竟想要什么?
我认为您只想使用 id=XXX 的值对容器进行处理。 像这样的http://aeromexico.com/es/viaja-con-aeromexico/equipaje/?site=mx ,如果您将 de 'mx' 更改为 'ar' 文本和标志将更改。
为此,您只需在模板中使用范围。 记住是加载的第一件事。 或者,如果您想将容器示例从内容类型列表更改为其他内容,您将需要该内容类型的确切位置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.