Go Back   HostGator Peer Support Forums > General Discussion > Webhosting

Notices

Reply
 
Thread Tools
  #1  
Old 12-29-2005, 05:53 PM
2timesover 2timesover is offline
Hatchling Croc
 
Join Date: Oct 2005
Posts: 1
Default SSI question

I do not want to rename all my files with the extention .shtml. What can I put in the htaccess file to include an rss feed?
Thanks in advance!
Reply With Quote
  #2  
Old 12-30-2005, 12:34 PM
Serra's Avatar
Serra Serra is offline
Veteran Croc
 
Join Date: Feb 2005
Location: Orange Park, FL
Posts: 5,073
Default Re: SSI question

If .shtml extension is needed to allow you to run code in your html files, then there is no way around it. html files with code in them will not run under .html.

You do not need to rename all of your files, just the ones with the RSS code on the page. If that is all of them, then you need to rename all of your files.
Reply With Quote
  #3  
Old 01-26-2006, 01:44 PM
Guerrero's Avatar
Guerrero Guerrero is offline
Baby Croc
 
Join Date: Nov 2005
Location: Spain
Posts: 56
Exclamation Re: SSI question

Quote:
Originally Posted by Serra
If .shtml extension is needed to allow you to run code in your html files, then there is no way around it. html files with code in them will not run under .html.

You do not need to rename all of your files, just the ones with the RSS code on the page. If that is all of them, then you need to rename all of your files.
I need also SSI #include in some accounts, but of course without renaming the pages.
We've tested in an pc-test server with apache and including some declarative lines in order to supporting the includes in all the .html and .htm pages an works nice.

Is it possible here? (I hope so)
Reply With Quote
  #4  
Old 01-26-2006, 03:23 PM
quietFinn's Avatar
quietFinn quietFinn is offline
Veteran Croc
 
Join Date: Feb 2005
Posts: 3,558
Default Re: SSI question

Quote:
Originally Posted by Guerrero
I need also SSI #include in some accounts, but of course without renaming the pages.
We've tested in an pc-test server with apache and including some declarative lines in order to supporting the includes in all the .html and .htm pages an works nice.

Is it possible here? (I hope so)
That is most likely not going to happen.

From "Apache Tutorial: Introduction to Server Side Include": http://httpd.apache.org/docs/1.3/howto/ssi.html

"A brief comment about what not to do. You'll occasionally see people recommending that you just tell Apache to parse all .html files for SSI, so that you don't have to mess with .shtml file names. These folks have perhaps not heard about XBitHack. The thing to keep in mind is that, by doing this, you're requiring that Apache read through every single file that it sends out to clients, even if they don't contain any SSI directives. This can slow things down quite a bit, and is not a good idea."

Actually I had not heard about XBitHack either... wonder if that'd be an option...
Reply With Quote
  #5  
Old 01-26-2006, 06:48 PM
Guerrero's Avatar
Guerrero Guerrero is offline
Baby Croc
 
Join Date: Nov 2005
Location: Spain
Posts: 56
Default Re: SSI question

Quote:
Originally Posted by quietFinn
That is most likely not going to happen.

From "Apache Tutorial: Introduction to Server Side Include": http://httpd.apache.org/docs/1.3/howto/ssi.html

"A brief comment about what not to do. You'll occasionally see people recommending that you just tell Apache to parse all .html files for SSI, so that you don't have to mess with .shtml file names. These folks have perhaps not heard about XBitHack. The thing to keep in mind is that, by doing this, you're requiring that Apache read through every single file that it sends out to clients, even if they don't contain any SSI directives. This can slow things down quite a bit, and is not a good idea."

Actually I had not heard about XBitHack either... wonder if that'd be an option...
with today servers and personal computers, I prefer the pages load took 0,73 seconds (being I happy) instead of 0,71 seconds (being I ratty).
<== <==
Reply With Quote
  #6  
Old 02-15-2006, 03:29 PM
neoncarrot neoncarrot is offline
Hatchling Croc
 
Join Date: Sep 2005
Posts: 2
Default Re: SSI question

Try adding this to your .htaccess:

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

I haven't tried it on HG, but it works OK on two other shared hosting accounts I have.

Obviously you dont want pages parsed if they have no SSI in them - as it'll push up server load and page load times - so I just use the .htm extension instead of .html for pages with no includes.
Reply With Quote
  #7  
Old 02-15-2006, 03:51 PM
Serra's Avatar
Serra Serra is offline
Veteran Croc
 
Join Date: Feb 2005
Location: Orange Park, FL
Posts: 5,073
Default Re: SSI question

Quote:
Originally Posted by neoncarrot
Obviously you dont want pages parsed if they have no SSI in them - as it'll push up server load and page load times - so I just use the .htm extension instead of .html for pages with no includes.
I don't see what the big deal is, why can't people just use the correct extensions? How hard is it to make shtml files for the few files that need SSI...
__________________
Six stages of Dedi Ownership

Fashionable broken link
image included
Reply With Quote
  #8  
Old 02-15-2006, 04:08 PM
Guerrero's Avatar
Guerrero Guerrero is offline
Baby Croc
 
Join Date: Nov 2005
Location: Spain
Posts: 56
Default Re: SSI question

Quote:
Originally Posted by neoncarrot
Try adding this to your .htaccess:

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

I haven't tried it on HG, but it works OK on two other shared hosting accounts I have.

Obviously you dont want pages parsed if they have no SSI in them - as it'll push up server load and page load times - so I just use the .htm extension instead of .html for pages with no includes.
Good idea. Thanks.

Serra: I prefer my time and my comfort than a little resources in the server.
anyway each day you will tented to using more and more SSI in order to including some "in all pages" info as header, menu, footer and so on.
or how you're resolving it?
if 40% or 50% of your pages need having SSI, then why worry about use separate extension?
Reply With Quote
  #9  
Old 02-15-2006, 11:56 PM
khepri's Avatar
khepri khepri is offline
Junior Croc
 
Join Date: Apr 2005
Location: Milton, FL
Posts: 132
Default Re: SSI question

Some reason you all do not want to write php pages?
Reply With Quote
  #10  
Old 02-16-2006, 02:50 AM
Guerrero's Avatar
Guerrero Guerrero is offline
Baby Croc
 
Join Date: Nov 2005
Location: Spain
Posts: 56
Default Re: SSI question

Quote:
Originally Posted by khepri
Some reason you all do not want to write php pages?
for "simple" static pages I think there is better using onlu html + js + css + SSI.
anyway php is taking also a lot of resources, sure more than SSI.

php or other cgi programming is for including really variable info not semi-static as I want.
Reply With Quote
  #11  
Old 02-16-2006, 07:25 AM
Serra's Avatar
Serra Serra is offline
Veteran Croc
 
Join Date: Feb 2005
Location: Orange Park, FL
Posts: 5,073
Default Re: SSI question

Quote:
Originally Posted by Guerrero
if 40% or 50% of your pages need having SSI, then why worry about use separate extension?
50% of your pages have SSI? That seems silly to me. PHP would be easier.

Quote:
Some reason you all do not want to write php pages?
Exactly.


Quote:
anyway php is taking also a lot of resources, sure more than SSI.
You can document that statement?
__________________
Six stages of Dedi Ownership

Fashionable broken link
image included
Reply With Quote
  #12  
Old 02-16-2006, 09:58 AM
Guerrero's Avatar
Guerrero Guerrero is offline
Baby Croc
 
Join Date: Nov 2005
Location: Spain
Posts: 56
Default Re: SSI question

Quote:
50% of your pages have SSI? That seems silly to me. PHP would be easier.
how do you include in your pages header, footer and menu?
other way is made it using js, I prefer SSI, only one line of code, simple and clear, maybe old style.

In pages with no interaction (no host variable data), for me, there is not reason for using php or cgi, then I'm using SSI for include fixed blocks as footer or menu. of course alse there is frames, but my mom don't like frames.


Quote:
anyway php is taking also a lot of resources, sure more than SSI.
You can document that statement?
can you document the opposite?

If a page don't need host data (only fixed text as menu or footer) why need I using php in order to include footer lines mainly in html+js ?
Reply With Quote
  #13  
Old 02-16-2006, 06:39 PM
Serra's Avatar
Serra Serra is offline
Veteran Croc
 
Join Date: Feb 2005
Location: Orange Park, FL
Posts: 5,073
Default Re: SSI question

Quote:
Originally Posted by Guerrero
can you document the opposite?
No, I can't. I see no evidence that PHP is any slower or faster than SSI. That is way I'm asking.

As for including headers and footers, php is very easy and works very well for that.
__________________
Six stages of Dedi Ownership

Fashionable broken link
image included
Reply With Quote
  #14  
Old 02-27-2006, 04:22 AM
Guerrero's Avatar
Guerrero Guerrero is offline
Baby Croc
 
Join Date: Nov 2005
Location: Spain
Posts: 56
Default Re: SSI question

but SSI and PHP are so fast that it really does not matter considering the advantages of using included files.
If you need to use PHP for other purpouses, then this is the way to go, but in sites or pages where php are not needed, SSI with html is the best in my opinion.
also for including header/menu and footer maybe (?) you can only need an include an one file.txt if using divs+css .
Reply With Quote
  #15  
Old 12-08-2006, 09:00 AM
doordie doordie is offline
Hatchling Croc
 
Join Date: Dec 2006
Posts: 3
Default How to customize adsense account?

How to customize adsense account?

I have all my pages in static html. As such if I want to change my adsense font, i.e adsense javascript to blend in my website how do I include a php include?

Thanks
Reply With Quote
  #16  
Old 12-11-2006, 04:35 PM
Guerrero's Avatar
Guerrero Guerrero is offline
Baby Croc
 
Join Date: Nov 2005
Location: Spain
Posts: 56
Default Re: How to customize adsense account?

Quote:
Originally Posted by doordie View Post
How to customize adsense account?

I have all my pages in static html. As such if I want to change my adsense font, i.e adsense javascript to blend in my website how do I include a php include?

Thanks
for me, this case (if you don't need any other php) can be made using SSI.
Reply With Quote
  #17  
Old 12-11-2006, 07:30 PM
gwyneth's Avatar
gwyneth gwyneth is offline
Supreme Croc
 
Join Date: Sep 2006
Location: up north
Posts: 6,843
Default Re: How to customize adsense account?

Quote:
Originally Posted by doordie View Post
How to customize adsense account?

I have all my pages in static html. As such if I want to change my adsense font, i.e adsense javascript to blend in my website how do I include a php include?

Thanks
If the file you want to include is in the same directory, put this in the page that's calling it:

<?php include 'filename.inc'; ?> where filename.inc is the file you're going to include (it can be a .txt file or an .html file and have those extensions but it's neater and keeps things clearer for your organization to call them .inc)

If you are making a number of files to include, you may want to create a directory/folder called 'includes' for them and make things neater with this in the headers of the pages that are calling them:

<? php ini_set("include_path", "../includes"); ?>

if necessary, changing the path as appropriate.

Either way, rename the calling page so it has a .php extension.
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -5. The time now is 09:46 AM.