search

Home  >  Q&A  >  body text

Can I have two different homepages on the same website?

I am working on a project. I'm cloning a website Make My Trip

https://www.makemytrip.com/

This website looks different on laptops and phones, and I mean completely different. So how do we implement such a function.

This is the view on the laptop

The same website on mobile

P粉899950720P粉899950720466 days ago703

reply all(1)I'll reply

  • P粉041856955

    P粉0418569552023-09-13 16:52:10

    The comprehensive answer depends on many factors that have not yet been disclosed. For example are you using a server side language like PHP and are all/most pages different?

    Detecting whether a website runs on mobile devices is not simple.

    One solution is

    1. Have a common index page, use JavaScript to get the screen size, and use Ajax to load the real mobile device page or desktop page

    2. Add a button/link to the page that allows the user to switch between mobile and desktop and saves the selection in a cookie/session.

    Another option

    I've seen some sites do this. A mobile version is always available by default and allows users to switch to desktop mode. The assumption here is that more people are using mobile devices, so the default setting will be correct for most people, and showing a smaller page on desktop is not as bad as showing a larger page on mobile .

    reply
    0
  • Cancelreply