Jump to content

html/php vs wml index files


real_illusions

Recommended Posts

hii'm currently trying to develop a mobile phone/device version of our website.however, theres a bit of a problem.the main index page is index.phpfor the mobile phone, its index.wmltrying to access the page (www.examplesite.com) from a phone, it doesn't read or find the wml file, it tries to read the php index page, which obviously doesn't work. i know this from the site logs. i then changed the index.wml to home.wml, but that didn't work. however, if you put the index.wml in the web address, like www.examplesite.com/index.wml it works.why does it do this? and how do you get the mobile phones to read the wml file without having to put that file onto the end of the web address??:)

Link to comment
Share on other sites

The PHP should detect if the device is a mobile phone or a PC and then redirect the user to the corresponding page. How you can do that is another question to which I can't answer though.

Link to comment
Share on other sites

  • 4 months later...
Guest Artic^MX

you need to declare a default page as index.wml in youyr webserver config. The default config conains that default pages are index.php index.html index.htm etc.

Link to comment
Share on other sites

That won't work. The default page list might look like this:index.phpindex.wmlindex.htmlIf there is an index.php, regardless of whether there is an index.wml or index.html, the index.php will always get sent because it is listed first. The server doesn't look at the client when deciding which page to send, you need to have the PHP script look at the user agent and figure out what to do. Have your PHP script parse $_SERVER['HTTP_USER_AGENT'] and try to detect if the user agent is a PDA or a phone, and if so redirect them to index.wml.

Link to comment
Share on other sites

Create an account or sign in to comment

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

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...