I have a requirement to use the same URL for both desktop and mobile devices. On mobile, I want to serve amp HTML while on the desktop I want to render normal HTML. In such case is it safe (from SEO and Adwords perspective) to detect the user agent and issue a rewrite rule to load amp HTML (from an internal URL) for mobile?
(I know of “link canonical” method of implementing amp for mobile devices. But in my case I need to use a common URL.)