I know redirect a website to mobile version such example.com
to m.example.com
is the best after responsive
design but my question is while the desktop URL
is example.com/index.aspx
and want to redirect to mobile version example.com/index_m.aspx
. or example.com/car.aspx
to example.com/car_m.aspx
. And html
and css
totally different with desktop version.
Goal:
With a function i detect user-agent
and want to redirect from example.com/gallery.aspx
to example.com/gallery_m.aspx
if device is mobile
or etc.
The questions:
- Is this good method at all? or harmful for
SEO
orgoogle index
? - If it's okay, which redirect i should use?
301
or302
- Should i use
canonical
tag?
is a setup where the server always sends the same HTML code to all devices and CSS is used to alter the rendering of the page on the device
, thus redirection isn't required. If you're going to separate the URLs of your desktop and mobile sites, you'll need to provide a signal to Google with a<link> tag with rel="canonical" and rel="alternate" elements
.302
redirects are recommended for this purpose.