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条)

报告相同问题?

悬赏问题

  • ¥15 mmocr的训练错误,结果全为0
  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀