Re: one uri for wap/html?

by "Peter Newton" <c-newton(at)ihug.co.nz>

 Date:  Sun, 1 Apr 2001 22:54:32 +1200
 To:  <hwg-languages(at)hwg.org>
 References:  jbarchuk
  todo: View Thread, Original
Thanks Jim,
I'm fine about redirecting the html to shtml however:-
My understanding is that to use ssi I have to put the command into my html
page like so.

<!--#exec cgi="filename.cgi"-->

because of the shtml extention the server will parse the page looking for
ssi commands on finding the one above it simply executes the filename.cgi
script and puts the output from that script back into the html document
replacing the ssi command and sends this (html) document back to the client.

The cellphone will I'm sure reject this page because it is html. I need the
server to send a WAP page instead of a html page if the html_user_agent is a
cellphone.

can u help?

many thanks
peter newton


> Hi Peter!
>
> > I need to be able to take an established html address ie:-
> >
> > http://mysite.com/index.html
> >
> > so that if it is accessed via a cellphone I can redirect it to an
approriate
> > WAP page.
> >
> > I've thought of SSI to get back to the server, but that has to be
embeded
> > into the html document which the cellephone I'm thinking will reject.
>
> (SSI is 100% transparent to the client; it doesn't get anything 'embedded'
> that the client can't understand.)
>
> Links should never have included '/index.html'. The domain name is
> mysite.com and that's all that's necessary. Not that index.html is faulty
> but it makes upgrades such as what you need more difficult. But if there
> are links to index.html beyond your control there is still a fix.
>
> Since SSI can solve your WAP-redirect problem the trick is to redirect
> index.html to index.shtml.
>
> Write an index.shtml page but name it testwap.shtml or something similarly
> 'nonstandard' to avoid confusion with the current 'server standard' page
> name index.html.
>
> When you -know- it works:
>
> - Rename testwap.shtml to index.shtml
>
> - Rename index.html to index.html.sav just to have a backup copy. Or just
> delete it if you feel excessively confident. :)
>
> - Create a symlink that points index.html to index.shtml
>
> The result is that:
>
> - Anyone who calls mysite.com will get the index.shtml. (Or depending on
> server default name priorities they may get index.html which immediately
> points to index.shtml.)
>
> - Anyone who calls mysite.com/index.html is immediately redirected to
> index.shtml.
>
> Have a :) day!
>
> jb
>
> --
> jim barchuk
> jb(at)jbarchuk.com
>
>

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA