Question about browser detection...

by 3 replies
4
I'm building a mobile html site for a client who has a php site. I have a php mobile redirect script I could insert into the client's index.php file, however he wants a landing page which allows the mobile user to choose between the mobile site and the regular site. If I have the redirect script point to the mobile landing page, when the mobile user clicks on the option for the regular site, it will keep bringing them back to the landing page. So I was thinking of naming the landing page as index.html (with the redirect script on it) to differentiate between that and the regular site's index.php. I am just wondering if this is possible, and if so, will the browser access the index.html extension by default over the php when the root domain is entered in the address bar? I hope my question is not too confusing.
#programming #browser #detection #question
  • Hi there,

    You can do this by adding in your .htaccess

    So by default, the main page will be index.php

    I hope this help
    • [ 1 ] Thanks
  • Thanks wasabi20,

    Actually I want to make sure that the index.html appears first, so I assume I would just change the last part of that code to html?
  • Hi there,

    Yes you have simply to put in .htaccess in the root directory (so the main folder ex: public_html or www)

Next Topics on Trending Feed

  • 4

    I'm building a mobile html site for a client who has a php site. I have a php mobile redirect script I could insert into the client's index.php file, however he wants a landing page which allows the mobile user to choose between the mobile site and the regular site. If I have the redirect script point to the mobile landing page, when the mobile user clicks on the option for the regular site, it will keep bringing them back to the landing page. So I was thinking of naming the landing page as index.html (with the redirect script on it) to differentiate between that and the regular site's index.php. I am just wondering if this is possible, and if so, will the browser access the index.html extension by default over the php when the root domain is entered in the address bar? I hope my question is not too confusing.