Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Howto use SSI w/out SHTML extension (Read 5977 times)
astropilot
God Member
*****
Offline



Posts: 828
Location: Louisville
Joined: Jun 18th, 2003
Gender: Male
Howto use SSI w/out SHTML extension
Jun 17th, 2004 at 4:57am
Print Post  
Hey gang,

I just thought I would throw up here some info that you hear little about, and that is how to parse HTML files without using the shtml extension.  "Why would you parse", well if you use Server Side Includes (SSI) you need to search the HTML file and execute the code, so Ironwings NewCal will show up on your homepage, and whoson will post the last 10 posts.....you catch my drift.

Using the shtml tag, you label your file to be parsed, but you also let everyone know that there is a script running in the background, which can be a security risk.  What this trick does is label your html file, but allows you to keep your normal file extension (htm/html).

THIS MAY NOT WORK ON EVERY SERVER! I think this only works with Apache. Some ISPs choose not to have this option.  This command makes the server running Apache backwards compatible and some think it is obsolete., but I love it.

Step 1.  Open up your .htaccess file in a text editor and remove all references to parsing shtml files.  Stuff like
Code
Select All
AddType text/html .shtml
AddHandler server-parsed .shtml
Options Indexes FollowSymLinks Includes 



Step 2:  Add this  to a new line
Code
Select All
XBitHack on 



Step 3:  chmod the html file that has the SSI call to 744.  This tags the file to be parsed.

Hope you find this useful.

astro-pilot
  

"For I am not ashamed of the gospel of Christ..."
Romans 1:16
---
http://www.ssflynn.com
www.flynnfarmsofkentucky.com
Back to top
 
IP Logged
 
JannoL
Full Member
***
Offline


I love YaBB 1G - SP1.31!

Posts: 165
Location: Home
Joined: Jul 27th, 2002
Gender: Male
Re: Howto use SSI w/out SHTML extension
Reply #1 - Aug 13th, 2004 at 11:42pm
Print Post  
It is very nice of you but isn't SSI kind of std on all servers hosting cgi ?

also, there must be a module installed on the server called 'include' something.

But more info is better than no info !

  Grin
  

Code Destructionator
Back to top
WWW  
IP Logged
 
astropilot
God Member
*****
Offline



Posts: 828
Location: Louisville
Joined: Jun 18th, 2003
Gender: Male
Re: Howto use SSI w/out SHTML extension
Reply #2 - Aug 14th, 2004 at 4:34am
Print Post  
JannoL,

You are correct in the fact that SSI is becoming more and more standard.  Even though it is standard does not mean you can throw some SSI into any webpage an it work, you have to tell the server to parse the file. (I'm sure you know this, I'm just reiterating my point)

Remember, this tutorial was to inform the avg user that you don't have to rename your files with the shtml extension; I really don't think the XBitHack on trick is too widely known.  And if it is, consider this for newbies.

astro-pilot

PS For Apache you need mod_include for SSI to work.
  

"For I am not ashamed of the gospel of Christ..."
Romans 1:16
---
http://www.ssflynn.com
www.flynnfarmsofkentucky.com
Back to top
 
IP Logged
 
JannoL
Full Member
***
Offline


I love YaBB 1G - SP1.31!

Posts: 165
Location: Home
Joined: Jul 27th, 2002
Gender: Male
Re: Howto use SSI w/out SHTML extension
Reply #3 - Aug 14th, 2004 at 5:07am
Print Post  
It's great that you provide help for everybody, also this trick could be used with html files but as I have understood there is also reasons why shtml is used as file exstension, faster access since the server parse every file and with shtml it only parse those and not the html, servers security is often set regarding mime type and also the servers modules is usually set for include and exec SSI calls. It is only CERN servers that haven't SSI support and they usually provides fakessi.pl so that might be why this hack isn't that well known hack or am I totally lost ? I haven't actually been programming in about 4 years so there might been a lot of updates that I missed.

Sorry, just read a little about XBitHack, I was lost...

You're the KING Grin

Ohh, i forgot to say that this hack work on both CERN and the all common NCSA servers...
  

Code Destructionator
Back to top
WWW  
IP Logged
 
astropilot
God Member
*****
Offline



Posts: 828
Location: Louisville
Joined: Jun 18th, 2003
Gender: Male
Re: Howto use SSI w/out SHTML extension
Reply #4 - Aug 14th, 2004 at 8:51am
Print Post  
The KING, I'm not.  Thanks for the info on the other servers.

astro-pilot
  

"For I am not ashamed of the gospel of Christ..."
Romans 1:16
---
http://www.ssflynn.com
www.flynnfarmsofkentucky.com
Back to top
 
IP Logged
 
oldgoat
Full Member
***
Offline


!

Posts: 102
Location: York
Joined: Aug 3rd, 2004
Gender: Male
Re: Howto use SSI w/out SHTML extension
Reply #5 - Nov 18th, 2004 at 7:48pm
Print Post  
Quote:
The KING, I'm not.

well, not if you're referring to Elvis Presley, I guess!

(Can't say I'm a fan of his - Led Zeppelin for me)

anyhow, given that this server mod is geared for Apache, I'm intrigued as to how it might work for IIS, since an app path is mapped to the fiile extension, but as the .pl files have to be mapped to the PERL dll.

Might try and see what happens with possibles....
  

formerly known as s_m_b
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint