dongxi7609 2015-05-08 12:30 采纳率: 0%
浏览 39
已采纳

Pimcore多语言站点静态路由

I've just recently started working with Pimcore in my work and I'm now on a project consisting of three languages each in their seperate tree.

Today the sites URL is my-site.com/LANGUAGE/sub-page For example: my-site.com/se/about

But what we would want to have is LANGUAGE.my-site.com/sub-page. For example: se.my-site.com/about

I've tried using the static route tool but couldn't get it to work at all and my knowledge of pimcore is somewhat limited. I found the Pimcore documentation on static routes (HERE) but I didn't find it all that helpful.

Do I need a controller and an action to handle this. Or can it be done simply with the static route tool?

EDIT: I've tried to use the "domain tool" from when you right-click a site. But this only works if I change in the hosts file of the computer by setting 127.0.0.1 to be connected to us.MYSITE.com. Won't this be an issue for when the site goes live? Since the users don't have my hosts file. That is why I went down the road of static routes.

  • 写回答

2条回答 默认 最新

  • duanhe0817825 2015-05-08 14:45
    关注

    There is the "Sites" - feature in Pimcore that lets you do this.

    The documentation page describes how you set this up, but I'll explain it quickly:

    You basically set up your document tree like this, creating a usual document for each of your languages:

    Document Tree

    After this, all you need to do is change these documents into "Sites" (picture taken from the docs) by right clicking and clicking "Use as site":

    Multisites in Pimcore

    As you can see, the popup now offers you a field where you can add and edit new domain-names, as well as subdomains. Depending on what version of Pimcore you are using, this may look a little different, the documentation shows an older version.

    This is probably what you will see in a newer version after creating the site, right clicking it and going to "Edit Site":

    Pimcore Site options

    This offers a slightly nicer way to manage your domains and additional ones, you don't have to add additional domains by editing a comma seperated list, now every line in the textarea resembles a domain. So what you need to do is enter your language-subdomain as main domain.

    The site now acts exactly like the "Home" - Site at the Document-Root and the Site - feature acts similar to a static route you would set up.

    Now what you need to do additionally is set your server up to route the subdomain to your pimcore - folder, this answer will probably help you out. There won't be a problem with the host - files as you mentioned, as they are stored on the server anyhow, the user does not need to have these, so using the "Sites"-feature is definitely the way to approach this problem over the static route - tool.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度