Jump to content

Extension talk:MobileFrontend/Configuring browser auto-detection

Add topic
From mediawiki.org

Autodetection (mobile and desktop domain)

[edit]

Hi all,

I have a question concerning auto Detection.

We have the latest MW and the latest Version of MobileFrontend at an windows server with IIS 7 and frontend caching We also have a "normal" domain - lets call it "wiki.de" and a mobile subdomain "m.wiki.de".

Via index.php we redirect all mobile devices using the php script from detectmobilebrowsers.com/ to "m.wiki.de". Both domains refer to the same index.php and data-path at the same server.

Now the Question: Where the hell the mobile domain knows, that it should constantly deliver the mobile view?

Hope anyone can give me a hint. Thank You --Mstre (talk) 09:45, 16 May 2013 (UTC)Reply

Having the exact same problem. It would be very helpful if this was either properly explained here or there was a link for more info. --Jussi24 (talk) 16:00, 19 June 2013 (UTC)Reply

Expand instructions

[edit]

Since setting up auto-detection via webserver or proxy-cache is more complicated as stated in the instructions, we are not getting any instructions to do it? It will be cool to have proper instructions here. --[[kgh]] (talk) 14:06, 4 May 2015 (UTC)Reply

Why doesn't Vary: User-agent work?

[edit]

The page states that $wgMFAutodetectMobileView "is NOT compatible with front-end caching". Why doesn't sending a Vary: User-agent HTTP header in the response notify the cache of the difference? --Damian Yerrick (talk) 16:03, 10 June 2016 (UTC)Reply

Short version: "Vary: User-Agent" is a terrible idea which should never be used anywhere. Long version: it basically disables the cache, because there are thousands of different user-agent strings, and "Vary: User-Agent" wouldn't allow one Firefox to get the cached version of the page which was made for a slightly different Firefox. This is basically "cache is not working". Edward Chernenko (talk) 16:17, 4 January 2017 (UTC)Reply

Using mod rewrite to force mobile view in mobile subdomain

[edit]

Since these instructions leave much to be desired, I figured out a way to make the mobile subdomains work for me. I dont know if this breaks anything, but for the moment it seems to do what I want it to do.

# Short url for wiki pages
RewriteCond %{HTTP_HOST} ^(www\.|)de\.m\.mywiki\.de$ [NC]
RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/de/index.php?useformat=mobile [QSA,L]

# Redirect to Main Page
RewriteCond %{HTTP_HOST} ^(www\.|)de\.m\.mywiki\.de$ [NC]
RewriteRule ^/*$ %{DOCUMENT_ROOT}/de/index.php?useformat=mobile [QSA,L]

--Baumgeist (talk) 15:53, 4 September 2016 (UTC)Reply