duanli9591 2013-10-01 18:45
浏览 39
已采纳

如何将子域指向特定的包?

How can I point a subdomain to a specific bundle. I have this vhost:

<VirtualHost *:80>
    ServerName subdomain1.mysite.dev
    ServerAlias subdomain2.mysite.dev

    DocumentRoot /mysite/web
    <Directory /mysite/web>
        AllowOverride All
        Order allow,deny
        Allow from All
    </Directory>

</VirtualHost>

This /etc/hosts:

127.0.0.1       subdomain1.mysite.dev subdomain2.mysite.dev

And this app/routing.yml:

subdomain1:
    resource: "@ProjectSubdomain1Bundle/Resources/config/routing.yml"
    host: subdomain1.mysite.dev

subdomain2:
    resource: "@ProjectSubdomain2Bundle/Resources/config/routing.yml"
    host: subdomain2.mysite.dev

This way both subdomains goes to Subdomain1Bundle.

  • 写回答

1条回答 默认 最新

  • duanrui3480 2013-10-01 21:11
    关注

    Sorry, I'm shamed. I just needed to clean the production cache:

    app/console --env=prod cache:clear
    

    Because I was developing before with server:run mode. Anyway I will keep the above example because it works perfectly.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 vmware exsi重置后登不上
  • ¥15 易盾点选的cb参数怎么解啊
  • ¥15 MATLAB运行显示错误,如何解决?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题
  • ¥20 yolov5自定义Prune报错,如何解决?
  • ¥15 电磁场的matlab仿真
  • ¥15 mars2d在vue3中的引入问题
  • ¥50 h5唤醒支付宝并跳转至向小荷包转账界面