WAP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreWAP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old October 4th, 2000, 07:54 PM
pdmackenzie pdmackenzie is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Location: toronto, on, canada
Posts: 5 pdmackenzie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
In apache (virtually hosted), I want to have an index.html page that browsers will load automatically, and an index.wml page that my mobile browser will load automatically. Unfortunately, when I access the site through my handset, it continues to load the index.html page. (I have added the new extension types to the .htaccess file, if that makes any difference.) What can I do?

Reply With Quote
  #2  
Old October 5th, 2000, 03:42 AM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Arrange the order of it.

i.e. DirectoryIndex index.wml index.html

Reply With Quote
  #3  
Old October 5th, 2000, 12:03 PM
pdmackenzie pdmackenzie is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Location: toronto, on, canada
Posts: 5 pdmackenzie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I assumed that using the DirectoryIndex directive in this fashion would mean that browsers would (intuitively?)skip over the index.wml and go to the index.html. However, all that I get is a prompt for what application I should use to open index.wml, which is obviously not what I want. (Also, going to the site now using the handset results in a "Web Service Problem:..." message).

Reply With Quote
  #4  
Old October 5th, 2000, 12:28 PM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Oh, I now see what the problem is. So are there any unique environment variable accessing from your mobile browser? Maybe the HTTP_USER_AGENT?
If so, you can use mod_rewrite to _External_ redirect the requests that match such HTTP_USER_AGENT to http://www.domain.com/index.wml while leaving others to http://www.domain.com/index.html or just http://www.domain.com/

Reply With Quote
  #5  
Old October 6th, 2000, 02:44 PM
pdmackenzie pdmackenzie is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Location: toronto, on, canada
Posts: 5 pdmackenzie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I read through the mod_rewrite documentation, and it seems a little daunting (all those regular expressions). Does the regex engine follow the same rules as the Perl regex engine I am familiar with? I am starting to think it may be easier to php3-ize the index page, then have it redirect any weird user-agents to the index.wml file.

Reply With Quote
  #6  
Old October 6th, 2000, 05:17 PM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
>>Does the regex engine follow the same rules as the Perl regex engine

Yes

>>php3-ize the index page, then have it redirect any weird user-agents to the index.wml file

The right approach, it should load much faster, since mod_rewrite is flexible and powerful but slow.

I asked you for the HTTP_USER_AGENT of your mobile browser but you haven't provided me that, so I am unable to write the mod_rewrite rulesets for you.



Reply With Quote
  #7  
Old October 9th, 2000, 09:35 PM
pdmackenzie pdmackenzie is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Location: toronto, on, canada
Posts: 5 pdmackenzie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Sure! The user agent is "UP.Browser/3.01-QC12 UP.Link/3.2.3.7" .

Reply With Quote
  #8  
Old October 10th, 2000, 11:36 AM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Okay, place this to http://www.domain.com/.htaccess

#############################################

RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} ^UP.Browser/.*
RewriteRule ^$ index.wml [L]

#############################################

Such RewriteRule matches requests to the following URLs with your UP.Browser useragent:
http://www.domain.com/ or http://www.domain.com

and Internal redirect to http://www.domain.com/index.wml What Internal means is that the user sees http://www.domain.com/ instead of http://www.domain.com/index.wml

For all other wml page requests, your index.wml page more than likely will have a link to those other pages, in this case, such request will not follow the rewrite rule set.

RewriteRule ^$ matches any request that starts with nothing and ends with nothing, that is basically a request of http://www.domain.com or http://www.domain.com/
If someone requests http://www.domain.com/index.wml directly, then it will ignore the ruleset.

If you want request http://www.domain.com or http://www.domain.com/ to redirect to http://www.domain.com/index.wml (what user sees), then use External redirect. That is, replacing the [L] with [R,L].

[This message has been edited by freebsd (edited October 10, 2000).]

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreWAP Programming > accessing hdml pages through apache...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway