Welcome to WebmasterWorld Guest from 54.163.100.58

Forum Moderators: Ocean10000 & incrediBILL & phranque

Making .htm file run like .shtml

   
3:03 am on Feb 23, 2004 (gmt 0)

10+ Year Member



Hi,
I would like to know how would be the rule to make .htm and .html files run on the server like shtml.
I need to use some includes and I can't go throught the whole site renaming files and fixing links.

I also need to know how to set a rule to send every request to www.mydomain.com/-/ to www.mydomain.com .

Thanks a lot for helping.

5:14 am on Feb 23, 2004 (gmt 0)

WebmasterWorld Senior Member keyplyr is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



For the 1st question, try adding this to .htaccess:

AddType text/x-server-parsed-html .html

However, your host is the best place to get this info since it depends on how they have the server configured.

5:45 am on Feb 23, 2004 (gmt 0)

WebmasterWorld Senior Member marcia is a WebmasterWorld Top Contributor of All Time 10+ Year Member



There's a good SSI tutorial in the official Apache documentation

[httpd.apache.org...]

4:24 am on Feb 24, 2004 (gmt 0)

10+ Year Member



I tried like this and didn't work.
Options +Includes
AddType text/x-server-parsed-html .htm
AddType text/html .htm
AddHandler server-parsed .htm

I think there is something missing?

Thanks

4:42 am on Feb 24, 2004 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



From the link Marcia provided: [httpd.apache.org...]

You said you wanted to parse .htm and .html for SSI, but the code you posted only enables .htm parsing.

Jim

5:15 am on Feb 24, 2004 (gmt 0)

10+ Year Member



Yes, but for now I started testing only with .htm
and it's not working.
I am getting [an error occurred while processing this directive] .
I guess there is something missing.
Thanks
5:29 am on Feb 24, 2004 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



That message is the standard error message for SSI code errors - Which means that you have successfully activated SSI, but one of the SSI directives on your page has a bug.

If you have SSI-included files that themselves include other SSI, make sure those filetypes are also being parsed for SSI - That's one of the easier ways to cause this problem. For example if you use SSI to include a file called footer.std, and footer.std uses SSI to add "This page last modified" and the Last-modified date to your footer, then you'll have to enable SSI parsing for filetype ".std".

Jim

5:06 pm on Feb 24, 2004 (gmt 0)

10+ Year Member



Jim, thanks for helping.
But I still don't have it working. Let me explain.
The file is a basic .htm file with some text in it. It has a include to another .htm with just 1 word in it, no more SSI.
When I put the file on the web and try to run, I get the error. But if I save the same file as .shtml and run, it works.
That's why I think there is something missing, it's like the .htm is not being completed parsed. I don't think is a problem with the code or the .shtml wouldn't work too.
Right?
Thanks again
7:30 pm on Feb 24, 2004 (gmt 0)

10+ Year Member



This should be a simple rule but is not working.
Could anybody else help?
Thanks
7:43 pm on Feb 24, 2004 (gmt 0)

10+ Year Member



You know what?
I guess it only works for .html but not for .htm
at least for me
with rule
AddType text/html .html
AddHandler server-parsed .html

I can make the .html be parsed fine

but with rule

AddType text/html .htm
AddHandler server-parsed .htm

I can't!

Anybody knows why?

7:46 pm on Feb 24, 2004 (gmt 0)

WebmasterWorld Senior Member marcia is a WebmasterWorld Top Contributor of All Time 10+ Year Member



skuba, I've got it working with just this in .htaccess

AddType text/html .html
AddHandler server-parsed .html

I've had it working with a .txt file included, but this time with the host where I'm using it, it had to be an .html extension (or .htm - same thing) to get it to work. I used leftnav.html for the left navigation part - works fine.

Watch about the location of the page relative to the page where the included file will be; I find that the hardest part and sometimes end up putting the include in the same /folder/ to keep things uncomplicated for myself.

It did not work with /include.html in the root, it did work without the forward slash - include.html.

Added:

Try using both of them, with separate entries and see what happens

AddType text/html .html
AddHandler server-parsed .html

and

AddType text/html .htm
AddHandler server-parsed .htm

I realize there might be better or shorter ways, but I try to idiot-proof everything for myself. :)

8:11 pm on Feb 24, 2004 (gmt 0)

10+ Year Member



I know what you mean. But see, it has nothing to do with where the included file is , or the linking , etc...Because it works for the html file. It just doesn't work for the .htm.
So, the problem is related to the parsing of the file.
1:44 am on Feb 25, 2004 (gmt 0)

10+ Year Member



Anybody else could help getting my .htm files parsed?
I've been trying like crazy.
Thanks a lot.
1:48 am on Feb 25, 2004 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



See mod_include [httpd.apache.org], and XBitHack.

Jim

10:29 pm on Feb 26, 2004 (gmt 0)

10+ Year Member



It finally work with that

Options +Includes
XBitHack on
AddType text/html .htm
AddHandler server-parsed .htm

thanks

 

Featured Threads

Hot Threads This Week

Hot Threads This Month