Currently, only the index page is .asp and has code in the header to detect mobile devices. So if someone goes to our website on a mobile phone they are redirected to the mobile site. All the other pages are .html. If someone uses google search and happens to find a page deeper within our site, and they are on a mobile device, then they get the regular website page. We need them to get the mobile equivalent of that searched page, since they are on mobile.
Is there a way to use a single .asp page to detect mobile devices for all our web pages? Or does each web page need to be .asp and have the redirect code in the header as our homepage does?
One reason for wanting only one asp page is so that if there are changes to the detection code, it only has to be done in one place... not on every single webpage.
We are using IIS. We have the mobile site under a folder called mobile separate from the regular website... so pointing to it is easier if need be.
If more specifics are needed... let me know.