I am missing any point you have here. Can you define how to "optimise the website for mobile"?
Acorn
Printable View
I believe what David is referring to is the OP states he has 55 pages on his desktop site but want's a reduced number on the mobile version. That should be covered by a sitemap.xml file.
Thank Egg, got it.
The only current way to have fewer than 55 mobile web pages is to add a meta referral to those pages that not wanted to be viewed in mobile mode.
The trick is to decide where the user is led: add to the unwanted page's headers - <meta http-equiv="refresh" content="0; url=index.htm" /> is too simple a cop out, so a careful map of Main to redirected Mobile page is essential. Each unwanted page can be totally blank as it is never viewed.
Acorn
Just to be clear. I did not want to create a variant, but to create a separate website with just a few pages which would be a mobile version and it could be linked to the main site. I recall a few years back that this was possible.
Miko, my coding does that just as well. You create two design files and publish both to the same location. One (let's call it Main has index, etc; the second and subsequent have index-s, index-m or index-l and associated other pages following the same pattern. i put all four sizes in one file to same all the knitting four separate files incurs. You then block out the mobile pages you don't need.
My approach allows for a transition from any page to any same page of a different width. If you don't need that flexibility, you would simply use a small part of the code to immediately redirect to the mobile site index page:
You would place this in your index page head.Code:<script>
vpw = window.innerWidth;
if (vpw <= 600) {
location = "mobile/index.htm";
}
</script>
Acorn
Many thanks, Acorn, I will give it a try when I have a few minutes. Also thanks to all who have contributed.