You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by st...@msoe.edu on 2006/04/26 19:14:53 UTC
[users@httpd] .htaccess and WAP 1.1
Hello,
I'm having trouble rewriting URLs with my .htaccess file when I connect
using a WAP 1.1 phone. I've looked around and found a number of postings
about configuring Apache for access to index.wml, but I just want to have
a rewrite no matter what browser I connect with. Any ideas of how to get
this to work or suggestions on better approaches would be greatly
appreciated.
Here's my current .htaccess:
.htaccess
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.urlAA.net$ [OR]
RewriteCond %{HTTP_HOST} ^urlAA.net$ [OR]
RewriteCond %{HTTP_HOST} ^mm.urlAA.net$
RewriteRule ^(.*) http://www.urlBB:8080/myservlet/$1 [R,L]
When I connect with IE or Firefox to www.urlAA.net/m/nate, I get directed
to www.urlBB:8080/myservlet/m/nate. This then lets me download my WML
data. When I attempt to do the same with my phone (WAP v1.1), I get a 404
error.
I was able to get my phone to connect by "hacking" my .htaccess file:
.htaccess #2
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.urlAA.net$ [OR]
RewriteCond %{HTTP_HOST} ^urlAA.net$ [OR]
RewriteCond %{HTTP_HOST} ^mm.urlAA.net$
RewriteRule ^(.*) http://www.urlBB:8080/myservlet/m/nate [R,L]
Now my browsers and my phone can successfully access the data. However,
the "nate" part of the URL is a username field. This means I can't
hardcode it to nate in the .htaccess file because it will be different for
each user.
Am I missing something simple here?
Thank you for the help,
-Nate
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] .htaccess and WAP 1.1
Posted by st...@msoe.edu.
Hello,
I tweaked the IP address, but here is what was logged when I get the 404
from my phone:
555.555.555.555 - - [02/May/2006:18:38:42 -0500] "GET /m/nate HTTP/1.1"
404 - "-" "SIE-SL56/10 UP.Browser/6.1.0.5.c.5 (GUI) MMP/1.0
UP.Link/5.1.2.9"
Thanks for the help,
-Nate
> On 4/26/06, stoddarn@msoe.edu <st...@msoe.edu> wrote:
>
>> When I connect with IE or Firefox to www.urlAA.net/m/nate, I get
>> directed
>> to www.urlBB:8080/myservlet/m/nate. This then lets me download my WML
>> data. When I attempt to do the same with my phone (WAP v1.1), I get a
>> 404
>> error.
>
> What messages do you see (if any) in you erro or access log when you do
> this?
> Can you switch on rewritelog with a high debug level?
>
> Krist
>
> --
> krist.vanbesien@gmail.com
> Solothurn, Switzerland
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] .htaccess and WAP 1.1
Posted by Krist van Besien <kr...@gmail.com>.
On 4/26/06, stoddarn@msoe.edu <st...@msoe.edu> wrote:
> When I connect with IE or Firefox to www.urlAA.net/m/nate, I get directed
> to www.urlBB:8080/myservlet/m/nate. This then lets me download my WML
> data. When I attempt to do the same with my phone (WAP v1.1), I get a 404
> error.
What messages do you see (if any) in you erro or access log when you do this?
Can you switch on rewritelog with a high debug level?
Krist
--
krist.vanbesien@gmail.com
Solothurn, Switzerland
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] .htaccess and WAP 1.1
Posted by st...@msoe.edu.
Hello,
I'm confused by most of your responses, but can we discuss the configuring
response more? I'm trying to redirect users going to urlA to urlB, so I
setup an htaccess file. When I use a desktop browser I'm redirected,
without an issue, and I can see the WML data. However, when I use my cell
phone I get a 404 error.
Here is my understanding about how the redirects work:
My browser The server
---------------------------------
GET urlA ------>
<------- Response 302 (go to urlB)
GET urlB ------>
<------- urlB data
I found an online tool that output the HTTP response header and let me
configure a User-Agent and Accept-Encoding. What I found was I received
the 302 redirect HTTP response as expected, but the content-type was
"text/html". I'm not 100% sure here, but I think I need the HTTP response
to be of content-type "text/vnd.wap.wml" (or something similar to that).
Does this seem logical? If so, any ideas how I can configure the
content-type in my htaccess file?
Thanks for the help,
-Nate
> On Monday 01 May 2006 19:10, stoddarn@msoe.edu wrote:
>
>> I guess a better question is: What format does Apache return to the
>> browser when a page is redirected? Is it HTML, WAP or something else?
>
> That's entirely up to the person configuring it.
>
>> The Not_working phone's accept also has */*. Does that effect what
>> Apache will return
>
> It may do.
>
>> on redirects?
>
> What have redirects got to do with anything?
>
>> I'm not sure why that phone would send
>> that in the accept header, since it obviously can't really support */*
>> like a standard desktop browser.
>
> Maybe it accepts */* as a download (which would be equivalent to
> a desktop system)?
>
>
>> > .htaccess
>> > RewriteEngine on
>
> Ugh. So you've reinvented the wheel? No wonder it's square.
>
>
> --
> Nick Kew
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] .htaccess and WAP 1.1
Posted by Nick Kew <ni...@webthing.com>.
On Monday 01 May 2006 19:10, stoddarn@msoe.edu wrote:
> I guess a better question is: What format does Apache return to the
> browser when a page is redirected? Is it HTML, WAP or something else?
That's entirely up to the person configuring it.
> The Not_working phone's accept also has */*. Does that effect what
> Apache will return
It may do.
> on redirects?
What have redirects got to do with anything?
> I'm not sure why that phone would send
> that in the accept header, since it obviously can't really support */*
> like a standard desktop browser.
Maybe it accepts */* as a download (which would be equivalent to
a desktop system)?
> > .htaccess
> > RewriteEngine on
Ugh. So you've reinvented the wheel? No wonder it's square.
--
Nick Kew
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] .htaccess and WAP 1.1
Posted by st...@msoe.edu.
Hello,
I guess a better question is: What format does Apache return to the
browser when a page is redirected? Is it HTML, WAP or something else?
I did some more experimenting with another person's cell phone, and I
found that their phone did NOT get the 404 message. Here are the WAP
profiles of the phones:
Not_working phone :
http://communication-market.siemens.de/UAProf/SL56_10.xml
Working phone :
http://motorola.handango.com/phoneconfig/v300/profile/v300.rdf
Not_working phone's supported versions:
HTML = 4.0
XHTML = 1.0
WAP = 1.2
Working phone's supported versions:
HTML = none
XHTML = 1.1
WAP = 2.0
I looked at the accept headers from the phones, and most of the ones I
expected to see where there for both phones.
text/html
application/xhtml+xml
application.vnd.wap.wmlc
application.vnd.wap.wmlscriptc
application.vnd.wap.xhtml+xml
The Not_working phone's accept also has */*. Does that effect what
Apache will return on redirects? I'm not sure why that phone would send
that in the accept header, since it obviously can't really support */*
like a standard desktop browser.
If I've posted in the wrong list, please let me know.
Thank you for the help,
-Nate
> Hello,
>
> I'm having trouble rewriting URLs with my .htaccess file when I connect
> using a WAP 1.1 phone. I've looked around and found a number of postings
> about configuring Apache for access to index.wml, but I just want to have
> a rewrite no matter what browser I connect with. Any ideas of how to get
> this to work or suggestions on better approaches would be greatly
> appreciated.
>
> Here's my current .htaccess:
>
> .htaccess
> RewriteEngine on
>
> RewriteCond %{HTTP_HOST} ^www.urlAA.net$ [OR]
> RewriteCond %{HTTP_HOST} ^urlAA.net$ [OR]
> RewriteCond %{HTTP_HOST} ^mm.urlAA.net$
> RewriteRule ^(.*) http://www.urlBB:8080/myservlet/$1 [R,L]
>
> When I connect with IE or Firefox to www.urlAA.net/m/nate, I get directed
> to www.urlBB:8080/myservlet/m/nate. This then lets me download my WML
> data. When I attempt to do the same with my phone (WAP v1.1), I get a 404
> error.
>
> I was able to get my phone to connect by "hacking" my .htaccess file:
>
> .htaccess #2
> RewriteEngine on
>
> RewriteCond %{HTTP_HOST} ^www.urlAA.net$ [OR]
> RewriteCond %{HTTP_HOST} ^urlAA.net$ [OR]
> RewriteCond %{HTTP_HOST} ^mm.urlAA.net$
> RewriteRule ^(.*) http://www.urlBB:8080/myservlet/m/nate [R,L]
>
> Now my browsers and my phone can successfully access the data. However,
> the "nate" part of the URL is a username field. This means I can't
> hardcode it to nate in the .htaccess file because it will be different for
> each user.
>
> Am I missing something simple here?
>
> Thank you for the help,
> -Nate
>
>
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org