Amplify Next.js Redirects

0

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
            }
        ]
    }
};

質問済み 2年前64ビュー
回答なし

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ