-
Notifications
You must be signed in to change notification settings - Fork 0
AMFSwitcher
Overview
The problem of a multichannel web is to identify correctly the device and to redirect it to the correct content, most of them have to type of content:
for PC (web browser) for mobile (mobile browser) transcoder (like opera, etc. etc.)
Normally the easy solution is to configure into httpd.conf a directive with mod_rewrite parse the user agent and the rewrite the URL to the url, this method is good but the big problem is to update frequently the configuration to the change of user agent.
AMF do this work with the AMFSwitcher module, a lot of company use this module to manage multichannel site.
Prerequisite
AMF51DegreesFilter, AMF51DegreesFilter, AMFDetectRightFilter, AMFDetectRightFilter, AMFWURFLFilter and AMFWURFLFilter must be configured and loaded.
Scenario |: Redirect to other site
We have in this case three different path with three DNS.
Open the file httpd.conf of your webserver. And configure this few parameters*:
PerlSetEnv FullBrowserUrl http://www.fullbrowsersite.com PerlSetEnv MobileVersionUrl http://www.mobilesite.com PerlSetEnv RedirectTranscoderUrl http://www.transcodersite.com** PerlTransHandler +Apache2::AMFSwitcher
Note: *FullBrowserUrl, MobileVersionUrl, RedirectTranscoder are optional, but minimum one of them must be set **if the parameter “RedirectTranscoder” is not set the transcoders are considered as mobile devices.
Scenario ||: Redirect the same site
In this case you can set relative path and you can tell to AMFSwitcher to manage query string parameters, so in httpd.con you have:
PerlSetEnv FullBrowserUrl /web PerlSetEnv MobileVersion /mobile PerlSetEnv RedirectTranscoderUrl /transcoder_dedicates_site PerlSetEnv WildCardRedirect true PerlTransHandler +Apache2::AMFSwitcher
The parameter WildCardRedirect pass the value in query string to the other url for example:
Scenario |||
The example that is proposed here is if you don’t want the redirection for some path:
PerlSetEnv FullBrowserUrl /web PerlSetEnv MobileVersion /mobile PerlSetEnv RedirectTranscoderUrl /transcoder_dedicates_site PerlSetEnv AMFSwitcherExclude /images/,php_test.php PerlTransHandler +Apache2::AMFSwitcher
The parmeter AMFSwitcherExclude permits to define which path you want where AMFSwitcher is off. So in this example the directory http://web/images/ and the file php_test.php (in any path) are excluded.
Scenario IV
If you manage different web apps (for pc and mobile) in same hosts you have more option:
PerlSetEnv FullBrowserUrl /web PerlSetEnv MobileVersion /mobile PerlSetEnv RedirectTranscoderUrl /transcoder_dedicates_site PerlSetEnv WildCardRedirect true PerlTransHandler +Apache2::AMFSwitcher
The parameter WildCardRedirect pass the value in query string to the other url for example:
Another parameters
ForceTabletAsFullBrowser For mobile device like tablets (like iPad) frequently it’s right that thay access to PC site, the parmater is
PerlSetEnv ForceTabletAsFullBrowser true
FullBrowserMobileAccessKey Sometime it’s possible to be able to mobile device to access on PC site, with AMF is simple you need to define the FullBrowserMobileAccessKey like:
PerlSetEnv FullBrowserMobileAccessKey fullbrowser #the value you can change
and in your mobile page write this link:
Desktop Version
Tutorial