Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
amotion

UPDATE REQUIRED Can I set my homepage to a different page for mobile only?

Recommended Posts

Hi people, especially @paul2009: you've posted a seemingly elegant solution to this dilemma before, link below.
It still works, but with an unfortunate serious side effect: google crawl sees the injected code as a redirect, and no longer indexes the page.

Anyone know a way to achieve this without the side effect?


 

Share this post


Link to post

Yes, if you are using a template with index pages then this can easily be achieved with just css. Just create two pages within the index, one for mobile and one for desktops.

Then adjust the below code with your page URLs and add it to you websites global CSS.

@media (max-width:640px){#your-desktop-page-URL {display:none!important}}

@media (min-width:640px){#your-mobile-page-URL{display:none!important}}

 


If you see an answer that was helpful please consider hitting the 121238226_Screenshot2019-11-02at14_53_39.png.0416997a5e856e0159fa1edbd624659e.png button on the right. 

Need help with your website or online store? Feel free to get in touch.

thompsonweb.design

Share this post


Link to post
1 hour ago, amotion said:

google crawl sees the injected code as a redirect

That's strange as it shouldn't cause any issues with crawlers. I know for a fact that sites are using it and being indexed correctly.

To help us understand, the issue you are facing, please share the error from Google.


If a response has helped you, please give thanks using the  like-20-mag.png.3997345d620e40b4760b5d7a667cad54.png button.
Need personalised help? I'm a professional Developer who works with Designers internationally. You can book me via my company's website. www.sf.digital

Share this post


Link to post

Hmm yes, I'm still troubleshooting it. I had deliberately hidden the mobile friendly page from indexing, as I preferred the main domain to be the one listed in search results. So perhaps it was the combination of the injected code and that?

I also had that injected code on both the main home page and the mobile page, so that they redirected to each other depending on the users screen res. Perhaps those vice versa redirects caused the indexing issue?

For now I've removed both the injected code and the noindex tag on the mobile page, added a link to the mobile page within my site, and requested reindexing. We'll see if  all the pages reappear.

Please let me know if you think the above were the likely causes, and if there's a way to keep the mobile page unlinked within my site, and not indexed, yet have my mobile and desktop pages redirect to one another based on screen size.

I'm nervous about search result visibility with testing now! But when I have time and perhaps a gap when I'm not concerned about search results, I'd like to get it working.

Share this post


Link to post

@amotion Are you working on a new(ish) site? The reason I ask is that Google often indexes a new site and includes all of it in its search database and then shortly afterwards drops some or all pages before adding them in again days or weeks  later. 


Please hit LIKE to share your appreciation of posts that are helpful or useful. 

The like button is somewhere over thereover-there.jpg

Of course, Likes don't pay the bills.. If you're looking for a Squarespace Developer you can hire me here

Share this post


Link to post

Thanks for your responses everyone.

I'm pretty sure this has been fixed (TBC by a future google crawl), most likely by removing the noindex tag from my mobile friendly page that is redirected to for small screens.
I also removed the redirect from the mobile page back to desktop/main homepage based on a larger screen detected, I can't be certain if this also helped (I've done this for another reason: so that google sees my site overall as "mobile friendly").


@colin.irwin not new, the site has been live for at least a couple of years, just these recent changes.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...