Can we have two different homepages for same website

Viewed 31
2 Answers

The comprehensive answer depends on many things not yet disclosed. Such as whether you using a server-side language such as PHP and whether all/most of the pages are different ?

It's not straightforward to detect if the site is running on a mobile.

One solution is to

  1. Have a common index page that uses javascript to grab the screen dimensions and uses ajax to load the real page mobile - or desktop

  2. Have a button/link on you page to allow the user to switch over from one to the other and save the choice in the cookie/session.

Another option

I have seen some sites do this. Always serve the mobile version by default and allow the user to switch to the desktop mode. The assumption here is that more people are using the mobile, so the default is correct for most people and a smaller page on a desktop is not as bad as a large page on a mobile.

You'll likely need to detect the mobile originating request and redirect it to the appropriate home page.

`<script>window.location.href = "http://www.w3schools.com"</script>;`

I found this answer that you may find helpful.

Detecting a mobile browser

Related