Hi!
I have a trouble with aws amplify redirects. I want, if enter to my app by phone it should redirect to phone version.
For example when user enter to https://alifshop.tj/?query it should redirect to https://m.alifshop.tj/?query .
On next.js I did it. And it works on my local machine. But doesn't work on AWS Amplify. But on Amplify doesn't work the condition. In any case it redirects.
Please help!
module.exports = {
async redirects() {
return [
{
source: '/(.*)',
has: [
{
type: 'header',
key: 'User-Agent',
value:
'Mobile|Android|BlackBerry'
}
],
destination: 'https://m.alifshop.tj',
permanent: false
}
]
}
};