Faidon Liambotis has submitted this change and it was merged.
Change subject: Ensure that Googlebot-Mobile gets redirected to mobile.
......................................................................
Ensure that Googlebot-Mobile gets redirected to mobile.
* The case-insensitive non-greedy match wasn't working and is tricky to read.
* Removal of "bot" from the original regex will ensure that Google-Mobilebot
is redirected appropriately because "mobi" is included in the User-Agent string.
* Removal of "bot" from the original regex is nondestructive, as there aren't
other bots that also have "mobi" or other mobile-identifying keywords in their
UA string that are accessing the desktop URLs under /wiki/.
Change-Id: I0739bc99b717b5de2e9b178a58225be865f0d0a7
---
M templates/varnish/text-frontend.inc.vcl.erb
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
MaxSem: Looks good to me, but someone else must approve
Faidon Liambotis: Looks good to me, approved
jenkins-bot: Verified
diff --git a/templates/varnish/text-frontend.inc.vcl.erb
b/templates/varnish/text-frontend.inc.vcl.erb
index 75b5fdf..691909f 100644
--- a/templates/varnish/text-frontend.inc.vcl.erb
+++ b/templates/varnish/text-frontend.inc.vcl.erb
@@ -23,7 +23,7 @@
sub mobile_redirect {
if ((req.http.User-Agent ~
"(?i)(mobi|240x240|240x320|320x320|alcatel|android|audiovox|bada|benq|blackberry|cdm-|compal-|docomo|ericsson|hiptop|htc[-_]|huawei|ipod|kddi-|kindle|meego|midp|mitsu|mmp\/|mot-|motor|ngm_|nintendo|opera.m|palm|panasonic|philips|phone|playstation|portalmmm|sagem-|samsung|sanyo|sec-|sendo|sharp|softbank|symbian|teleca|up.browser|webos)"
|| req.http.User-Agent ~ "^(lge?|sie|nec|sgh|pg)-" ||
req.http.Accept ~ "vnd.wap.wml")
- && req.http.User-Agent !~
"(iPad|Android.3|(?i)tablet|(?i)(?!google)bot|PlayBook|Wii)"
+ && req.http.User-Agent !~
"(iPad|Android.3|(?i)tablet|PlayBook|Wii)"
&& req.http.Cookie !~
"(stopMobileRedirect=true|mf_useformat=desktop)"
&& req.url ~ "^/wiki/") {
set req.http.MobileHost = regsub(req.http.Host,
"^(?:www\.(?=mediawiki))?((?:commons|species|meta|incubator|outreach|strategy|wikimania201[234])\.(?=wikimedia)|\w+\.(?!wikimedia|mediawiki)|(?=mediawiki|wikimediafoundation))(wikimedia|wikipedia|wiktionary|wikinews|wikisource|wikiquote|wikibooks|wikiversity|wikivoyage|mediawiki|wikimediafoundation)\.",
"\1m.\2.");
--
To view, visit https://gerrit.wikimedia.org/r/95532
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I0739bc99b717b5de2e9b178a58225be865f0d0a7
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dr0ptp4kt <[email protected]>
Gerrit-Reviewer: Brion VIBBER <[email protected]>
Gerrit-Reviewer: Chad <[email protected]>
Gerrit-Reviewer: Dr0ptp4kt <[email protected]>
Gerrit-Reviewer: Faidon Liambotis <[email protected]>
Gerrit-Reviewer: Mark Bergsma <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits