View Full Version : read .txt files as html

01-28-2003, 11:33 PM
Hailings Gentlemen!

I am new to this forum, so I'd like to bid my greetings to all of you first of all.

Now, here's my problem:

I am running a Star Trek related site on a free host. My site is designed to look and behave like a LCARS (computer) display, with touch areas, iframes and the like.

If I'd upload my files as .html pages, the host would stamp me a great ad banner on each of these pages, thus spoiling the whole look. I found a way to work around this by naming my HTML files as .txt files, which works perfectly well in IE5 and above because I get the file displayed like HTML pages. But this only works with IE.


Does anyone know of a way to convince NS, Opera, and Mozilla to treat pages with extensions other than .html to be displayed as HTML encoded web pages?

Maybe I didn't make myself clear enough (English is not my natal language):
IE seems to display a file dependent on it's CONTENT, and not by it's EXTENSION. Other browsers don't, so if they're told to load a file named "***.txt", they display it as plain text, regardless of it's content.

It would be of great help if anyone could provide me with a trick to work around this - non-Java preferred.

Thank you.

01-28-2003, 11:42 PM
even if i knew of a way to make this work, i'm afraid that i wouldn't tell you. that banner ad is part of the terms you agreed to when you got the space with your host. by bypassing that banner, you're breaking the contract that you made with them, and you're stealing that webspace from them. sorry.

01-29-2003, 12:12 AM
Sorry Worf, the ads are part of the "deal", you'll be better off spending $5-$10 per month on a real host with no ads.

01-29-2003, 01:57 AM
Sure. Configure the server to serve .blah as html. Could also be done with a .htaccess file. But perhaps your host doesn't allow that? :rolleyes:

01-30-2003, 10:21 PM
I'll try the .htaccess thing.

But, to make it clear to the "moralists":

I said I'm running a page with SEVERAL iframes in it. The beloved ad banner is displayed on the index page anyway; I DON'T see any need to display it in every single iframe again! (besides that, most of the iframes are so small that you'd have to scroll the iframe up/down/left/right to view all portions of the banner in it let alone the actual content... doesn't make much sense, don't you think?)

Of course, I could change the basic settings and get a popup window instead of a banner displayed. Let's see... that would make about 5 to 10 popups per operation, depending on the quantity of data displayed. Nice, eh?

Now would you like to visit such a site???

Ads may be ok, but when they become annoying...

Heavy banners and happy popups to all!

01-30-2003, 11:24 PM
don't use iframes o find a better hosting. I understand that it's stupid to have so much banners in the page, but the rules are the rules.

Insurrection not allowed ;)

02-01-2003, 12:33 AM
You sure sound like Borg:
Efficient, cold-blooded, and totally without imagination (smile!)
Well you said that insurrection is futile: how about a resurrection??

Nevertheless, I'll keep trying to solve the problem. Just wanted to say hello to you, because in MY universe, the Borg have become my FRIENDS.
Sic transit gloria mundi...


02-05-2003, 10:54 PM
this may be the answer to your problems:


02-06-2003, 07:25 PM
Try using
<meta name="Content-type" conent="text/html">

at the top of your pages
or search google for "Content-type="text/html" and see what you get.

02-07-2003, 01:20 AM
does your host support php?
if it does then u can call these .txt pages using php include and using the links so it comes up on the main page
all you have to do is add stuff like
etc.... to add affects to your page

1: ensure that your host supports PHP, if your host dose move on to step 2.

step 2: make your layout using normal html. step
3: delete every thing in the area that you want your content to show up. and replace it with this code
<?php if($page == "") { include "news.html"; } else { include "$page.txt"; } ?>

$page is the wild card page so if you want to include news your link would be ?page=news now if you change $page to something like $id the link would be ?id=news. you can change $page to what ever you would like but you must have a '$' at the beginning of the word or it will give you a parse error. step
4: all your links have to
be or it wont work. with out the extension if you want to use the extentsion then remove the .txt from the second include

if you need a free host that supports php then try these links

No ads (well that i know of)

Ads (i think most of them do)


http://www.spaceports.com/ Tested.






http://www.i-networx.de/ German language

http://www.hostultra.com/ Beware of porn-pop-ups. I tested it, but the pop-ups are bad.

well i hope this helps c-ya


02-07-2003, 01:23 AM
i forgot to metion then u need to save the file that will be including these files
or it won't work