Forum Moderators: phranque
We have spent a lot of time in redoing this to incorporate the ssi's. Should save tons of time in the future. But...should we continue? Abandon the idea? Switch hosts? This is really the first run in with the host. Only paying $10.00 per month, been with for 4+yrs and only downtime was scheduled.(1 30minute exception)
What ticks me off is I believe that index.shtml being a default is common, and expected.
I will be sending copies of your replies (if they go the way I think they will) to the host in an effort to get them to change their minds. So if you know the technical procedure especially if it's simple, feel free to include it. Maybe you can embarrass them into action.
Thanks,
Tom Beach
If the latter, the "rearchitecture" needed would probably amount to changing this line in the configutation file:
DirectoryIndex index.htm to this:
DirectoryIndex index.htm index.shtml You may well be able to do it yourself by putting the above line into a .htaccess file in your document root (ask your host!).
.htaccess
but your host has to be configured to read it. Basically it lets you change configuration options on a per directory basis. The problem is, apache then has to read the directory for .htaccess before each process, so hosts who worry about server load and or security tend to have this disabled.
There is nothing fundamentally wrong -- or difficult -- about doing what you're doing. Your host is making it sound "all mysterious" -- which is a typical sign that you need to chnage hosts.
Use the server header checker [webmasterworld.com] to acertain that you are hosted on an Apache server. If so, you can tell the server to parse (to "scan") all files for SSI includes by creating a file called .htaccess in your Web root ("home page") directory called ".htaccess". The server will read that file before serving any requested content, and act accordingly. No other action on your part will be needed.
In the .htaccess file, put this line:
AddHandler server-parsed .htm
If you upload this to your server, and it starts reporting 500-Server Error status, then your account is not set up to allow .htaccess files. Simply delete the .htaccess file in that case, and see paragraph one above.
Jim
I'm dealing with similar issues now, though it's making some decisions for setting up a couple of new sites where there will definitely be PHP used for some features.
AddHandler server-parsed .htm >>
I hate to ask the obvious but I must.
I am allowed index.htm and index.html
as defaults.
I have primarily used .htm for all files except the indexes for the numerous directories. For those I used .html. Only for my piece of mind so that if I unintentionally upload an index.html to my root directory both files will be there and I can easily delete the mistake without it being overwritten.
The question is if the pages I want to have server parsed are all .html would the line to include in the .htaccess file be:
AddHandler server-parsed .html or does
AddHandler server-parsed .htm cover both?
>>AddHandler server-parsed .html or does
>>AddHandler server-parsed .htm cover both?
AddHandler server-parsed .html .htm
I've used it that way so both are covered. What I've read though, is that they work separately, and to do it takes a little bit extra processing time, so that some will use only one of the two for the pages with the includes but not for some others, to save some processing time.
Just what I've read, someone who's tech-savvy will have to verify that it's accurate.
Added:
BTW, I'm so glad you asked about this topic at this particular time. I've been held up wondering and deciding what to do with file extensions on one new site in particular since there will be some PHP used for sure and it's always easier to plan in advance than make changes.
Correct. The server has to actually "look at" each file, and scan for "<!--#" sequences indicating SSI functions. For non-server-parsed files, the server does not need to look at the file content at all, it just transmits it to the requestor. So it *is* better to limit the number of files that need to be parsed for SSI (or php) includes, especially if you have a busy, popular site.
Tom, you can do this any way you like, as long as your host allows it. I certainly don't want to tell you how to architect your site's file-naming conventions, especialy since you have a plan and valid reasons for doing it the way you do. I just wanted to point out that you don't need to create a whole bunch of new files with .shtm or .shtml extensions just to enable SSI processing.
Jim
Note: They were uploaded ascii.
My best guess is that they will need to change the permissions in order for it to function as expected.
I have talked to a different tech on each call and they all agree that I should be able to, one way or another, have an index page that accepts ssi's without incurring a redirect. Now all i need to do is get the "engineers" to agree and make it happen.
Really the only question here is:
Do I have the contents of the .htaccess file correct?
Do I need both lines, is there anything missing?
Any advice?
It did save as .htaccess. There were no default extensions added.
And I uploaded it to my root directory.
Just want to be sure I'm not missing something and I'm blaming them for it.
Thanks,
Tom
What you have looks fine.
> Do I need both lines, is there anything missing?
The AddType line tells the server what MIME-type to return with .htm files. Since the server may already be configured to return text/html for common *htm* file types, you may not need this line. But it won't hurt.
> Any advice?
Yes, work with your host -- They're the only ones who know how the server is set up.
> It did save as .htaccess. There were no default extensions added.
> And I uploaded it to my root directory.
Good.
> Just want to be sure I'm not missing something and I'm blaming them for it.
Unless you've got syntax errors in your SSI calls, it should be working.
Lots of people have this "invisible .htaccess" problem. Most FTP clients have a setting or option to show hidden files. Sometimes its labeled as such, and other times it is part of the "command configuration." In this latter case, some clients allow you to redefine the "ls" command as "ls -al" which will show all files including hidden files that start with "." such as .htaccess.
Jim
So far, regardless that I'm editing an invisible file and the bits n bytes I'm inserting into it are not visible to anyone anywhere after it's saved on the server, I've had no problem with this "among the missing" file doing what it's supposed to do when it's supposed to do it - ALWAYS ASSUMING that I put the required info into it in the required form/syntax.... which is a bit of a crap-shoot with me....
In the advanced properties I found under the 'startup' tab:
Remote Site Folder:
/
Initialize Command: (use "," to seperate multiple commands:
Text box is blank. Is this where I would type
"ls -al"?
With the quotes?
Would you explain what that means?
And finaly is that l in ls an l as in little?
Sorry every answer sparks a new question.
Tom
Sites > Organize Sites > Select site to edit > Click Edit > Click Startup > Enter -al in the Remote File Mask box.
There are several sites I've done this for, including one where the host, like vkaryl mentioned, allows you to edit the .htaccess file through the control panel. In all cases, entering the -al in the Remote File Mask has resulted in the .htaccess file (and other "hidden" files) showing up just fine for editing.
Turned out on my host that there were quite a few more hidden files than I'd expected. If you don't anticipate needing to find hidden files very often, you might want to take out the -al Remote File Mask when you're done this time. All those extra files kind of clutter up the folder list.
<edit>Just noticed your other questions tbeach. Pretty much you just enter "-al" without the quotes in the Remote File Mask box. Very easy to do.</edit>