Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 575
  • Last Modified:

Firefox giving me firefox application/octet-stream for my 404 errors

Hello there,

Here is what I want to do ultimately.

www.xxx.com/303

That 303 is goes to a custom 404 error page and the error page checks to see what the 303 is. If it is a number it sends it deep within the site to a page that handles these numbers for a database.

Now, Internet Explorer interpreted my coldfusion template as being a text file and displayed all the text. Firefox give me the firefox application/octet-stream do you want to open error.

So, what I did was have my custom 404 error page simply redirect using javascript to another coldfusion template.

This works fine in Internet explorer all clean and dandy.

However, any page that mozilla/firefox/netscape would go to gets the "do you want to open or save the file" of type firefox application/octet-stream

If I add an .htm to the end of the 303 it says "do you want to open or save the file" of type .htm

It seems like firefox won't even accept any redirect page for whatever reason unless it is plain an simple.

Basically, I'm thinking this is a security protection in these browsers that I can't get around, but I don't know.

Thanks for your help!
0
jtreher
Asked:
jtreher
  • 4
  • 3
1 Solution
 
GrandSchtroumpfCommented:
It's a problem with mime types.
Instead of doing a redirection, you should use some coldfusion code to force the content-type to be "text/html".
I don't know the exact sytax though.
0
 
jtreherAuthor Commented:
Yes, I have actually read that Firefox sticks to some standards whenever it comes to mime types. Perhaps this needs to go to Coldfusion board?

I thought that if it wasn't even getting coldfusion to process the template, i.e. a 303 without a cfm extension wouldn't call up the CF server.
0
 
GrandSchtroumpfCommented:
First of all, i don't understand what you want to use the error404 page for... there are tools for url rewriting if that's whay you are trying to acheive.

I found the docs about specifying a content-type in coldfusion:
http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/tags-p56.htm
http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/tags-a17.htm
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
jtreherAuthor Commented:
The problem with the URL writing tools is that they all rewrite the query string as slashes where as I just want the ID after the slash. Plus, our org has a URL scan that prevents most of them from working properly.

Other than that, say that a user did indeed enter into the page incorrectly by typing in one of those URLs that lead to nothing, well, they get Firefoxes message to download the octet stream!
0
 
GrandSchtroumpfCommented:
If you use the error404, the url in the client browser will change:
1. your user enters www.xyz.com/303
2. page not found -> redirects to www/xyz.com/error404.cfm
3. if you include content here, the user will see url=www/xyz.com/error404.cfm, if you redirect to another page, the user will see url=www/xyz.com/otherpage.cfm


Are you running apache?
If so, you can use mod_rewrite.

For example, this is what mambo uses (.htaccess file):
It rewrites all urls to /Mambo/index.php.
Then the index.php can do whatever it needs to do such as db query, include content... And the url the client sees will not be changed.

##
# @version $Id: htaccess.txt,v 1.5 2005/01/22 23:00:27 spacemonkey Exp $
# @package Mambo
# @copyright (C) 2000 - 2005 Miro International Pty Ltd
# @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
# Mambo is Free Software
##

#
#  mod_rewrite in use
#

RewriteEngine On

#  Uncomment following line if your webserver's URL
#  is not directly related to physical file paths.
#  Update YourMamboDirectory (just / for root)

# RewriteBase /YourMamboDirectory
RewriteBase /Mambo

#
#  Rules
#

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php
0
 
jtreherAuthor Commented:
Actually we are using IIS. I've found that a 404 to CFM template give a coldfusion error. From another experts exchange question (not mine) I've found that a setting in IIS needs to be changed. However, I don't know if this is affecting me or not.

Hold off on the responses until I try a few things.

Thanks for the help!
0
 
jtreherAuthor Commented:
I'm still working on this, but the head webmaster is out on vacation, therefore, I am stuck waiting for her to get back and approve IIS changes
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now