Redirect user to mobile site and back to typo3 using typoscript

I found that if I use the typoscript below, I can redirect my users to the mobile version of the site, which has its own tree in the backend of my typo3 site.

[useragent = *iPhone*]||[useragent = *iPod*]||[useragent = *Android*]
config.additionalHeaders = Location: http://m.example.com/
[end]

This is a simplified version of the site, so I want to return to the full link to the site. But due to the fact that my typoscript above redirects users to the m-domain, I can not return to the site www.example.com.

Does anyone have any suggestions for writing text?

+3
source share
2 answers

You need an additional parameter in your link that you can use to disable redirection.

Try something like this:

# check for mobile browser
[useragent = *iPhone*]||[useragent = *iPod*]||[useragent = *Android*]
config.additionalHeaders = Location: http://m.example.com/
[global]

# undo mobile redirect if mobile param is set
[globalVar = GP:nomobileredirect > 0]
config.additionalHeaders =
[global]

http://www.example.com/?nomobileredirect=1 .

nomobileredirect-value , nomobileredirect Vars, .

config.linkVars = nomobileredirect,L
+4

GET config.additionalHeaders. , TS , . , , TS .

GET.

0

All Articles