Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

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:
Dell PowerEdge Servers
  #1  
Old September 15th, 2000, 04:23 AM
andy.w andy.w is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2000
Location: Nottingham, UK
Posts: 3 andy.w User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I am trying to use mod_rewrite and .htaccess on a linux box to rewrite the uri the user sees in the location bar.

I am doing a check to see if flash is installed when the user first visits the site, using a small flash movie and php to redirect to the same page with a flagged variable.

The user types "http://www.domain.com" into his browser; the script then redirects him to "http://www.domain.com/index.htm?flash_installed=false" or "http://www.domain.com/index.htm?flash_installed=true". I would like the location bar in the browser to display both locations as "http://www.domain.com/" so that if he bookmarks the site he has to redo the test each time and can pass the url on to other people correctly.

I've tried all the mailing lists, documents, etc. I can think off, but the mod_rewrite and .htaccess documents on the apache site are so complicated I can't work out how to do this.

Can anyone help?

Reply With Quote
  #2  
Old September 15th, 2000, 04:45 AM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
>>I am trying to use mod_rewrite and .htaccess

Unfortunately, you can't do this with mod_rewrite nor .htaccess, everything has to take place within your php script.

1) .htaccess is the 1st file that gets read b4 your php file and your process must take place within your PHP script
2) You can't pass PHP variables back to .htaccess
3) Unlike REMOTE_HOST and others, there is no environment variable that check for plugin


Reply With Quote
  #3  
Old September 15th, 2000, 05:10 AM
andy.w andy.w is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2000
Location: Nottingham, UK
Posts: 3 andy.w User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
But isn't the .htaccess read again when the page is sent a second time?

The browser recieves index.htm. The flash/php does its check, and then does one of two things: use a meta-refresh tag to redirect to "index.htm?flash=no" if flash isn't installed, or to "index.htm?flash=yes" if it is. The "index.htm" page is then sent again with revised content and the variable echoed in the URI.

Can I not use .htaccess to rewite the URI the second time, to remove the echoed variable, or would a rewrite actually remove the variable before the php gets it?

Sorry I don't get this, but i'm not sure what mod_rewrite actually does; is it sending a the page that exists at the revised uri, or simply changing the file's uri after its been sent?

If I can't do it in .htaccess, is it possible to send a header in php that will display the revised uri when it send the page to the browser?

Reply With Quote
  #4  
Old September 19th, 2000, 03:14 AM
forefront forefront is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Posts: 165 forefront User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 55 m 52 sec
Reputation Power: 8
Why not just ask the user if they want Flash?

You may wish to check usability studies at:
http://www.useit.com/

Reply With Quote
  #5  
Old September 19th, 2000, 03:50 AM
andy.w andy.w is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2000
Location: Nottingham, UK
Posts: 3 andy.w User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I am very aware of usability; Jakob and his site are always in my mind when putting together a site, along with his excellent book right by my desk.

I do, however, feel that he is somewhat detached from the reality of the web, and that a little bit of flash never hurt anyone if it helps "sell" the message of the site.

<rant>I am extremely aware that a lot of design on the web is for other designers, and that many sites exclude many people. I hate this with a passion, wish the designers concerned would stop "ego wanking", and that the browsers would stick to standards.</rant>

The use of Flash in question is just to "pretty" up the navigation bar at the top with a few visual effects for rollovers, rather than reams of complicated Javascript. If anything, the speed of download will be about the same as using plain HTML (actually XHTML, as I am attempting to make the site work as far down as Lynx and braille browsers). I wanted to redirect automatically, so people aren't asked if they want to to use Flash just to make the site look nicer. There is actually nothing on the site that the lack of Flash will break, or the user will even miss. It's just there as a small amount of "eye candy" for those who have capable browsers. Its use is so that users don't dismiss the design as being boring, like they do with amazon.com (which is, as far as I'm concerned, one of the best designed sites there is). The last thing I want, or need, is a Flash-only, Pentium XXX, 7GHz, 24" monitor, T3 connection, boo.com!

The whole point of rewriting the URL is actually all about usability; I want to make sure that if they bookmark the page, or pass the URL on, they use the correct URL. I don't want non-flash users to go to the flash version and get a broken icon.

IMHO it is also better usability to detect what the browser is capable off and adjust to it, rather than have to present 20 questions before you get into the site. YMMV.

If, at the end of the day, I can't find a way to rewrite the URL I'll simply not bother with the Flash, and stick to XHTML and CSS.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > use .htaccess/mod_rewrite to display URI as www.domain.com, not www.domain.com?test


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 1 hosted by Hostway