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

gefragt vor 2 Jahren64 Aufrufe
Keine Antworten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen