我正在使用MobileDetectBundle製作我的網站的移動版本。Symfony2 MobileDetectBundle重定向不起作用
我想重新定向到像使用示例中的移動網站。我的config.yml是自述文件中的內容的複製/粘貼。
mobile_detect:
redirect:
mobile:
is_enabled: true
host: http://mobilesite.local
status_code: 301
action: redirect
tablet: ~
switch_device_view: ~
但是當我點擊http://website.local什麼也沒有發生。我正在使用User Agent Switcher Firefox extension作爲移動瀏覽器顯示。
該捆綁看起來配置得很好,因爲當我使用is_mobile()
枝條助手時,它將我檢測爲手機。
有什麼想法?提前致謝。
Guillaume
謝謝,我本來可以花幾個小時弄清楚這個 – JuCachalot
謝謝,這工作!對於開發,您還可以在config.yml中設置以下密鑰:'cookie_expire_datetime_modifier:「+1秒」 – baris1892