Forum Moderators: phranque

Message Too Old, No Replies

index.shtml as a default

Is my host lazy or right?

         

tbeach

2:40 pm on Jul 18, 2004 (gmt 0)

10+ Year Member



I run a site that I was prepared to do a bit of an overhaul on by using ssi's for several things.
It is a craft mall type site and each vendor has their own directory. Now the index file for each of these directories is .htm. The plan was to change them all to .shtml to allow for the ssi. But in experimenting I have discovered that although the .shtml page does show up that there is some sort of redirect going on. It is not noticable when calling the page, (I take that back) When calling the page in the address bar instead of www.mydomain/directory/ it shows www.mydomain/dyrectory/index.shtml.
It didn't notice this at first and discovered the redirects when validating and viewing the index logs.
I asked my host if their unix server could be configured to accept index.shtml as a TRUE default without the redirects. After some glimmers of hope the final answer came: " We are extremly sorry, but it
isn't possible to rearchitect our servers for your index.shtml to directly
fetch the file."
My questions to you are: Is doing this as hard as all that? Rearchitect?
If I go ahead with the plan will I be jeopardizing the se positioning that we have. I'm assuming that when the site is crawled it will be abandoned upon finding a redirect. (Although this has not proven to be the case so far with the few pages we have tried this with)

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

encyclo

2:47 pm on Jul 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Tom, you don't mention what sort of server your host is running. Is it Windows or Unix/Linux with Apache?

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!).

tbeach

3:33 pm on Jul 18, 2004 (gmt 0)

10+ Year Member



<<you don't mention what sort of server your host is running. Is it Windows or Unix/Linux with Apache?>>
I know I am on a Unix server. They also run a Windows server which is source of a lot of confusion. They acquired the Windows in a merger and much of the documentation is directed towards those on the Windows server.
But I am definately on the Unix.
I do not have an htaccess folder now. It's not as simple as uploading the folder is it?

JasonHamilton

3:37 pm on Jul 18, 2004 (gmt 0)

10+ Year Member



it's a file.

.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.

tbeach

3:39 pm on Jul 18, 2004 (gmt 0)

10+ Year Member



oops, sorry you said htaccess file not folder.
I will ask them.
If so do I need to add any lines in the index.shtml to direct to the htaccess file?

tbeach

8:35 pm on Jul 19, 2004 (gmt 0)

10+ Year Member



I expected more of a "your host stinks" response.
Is my strategy faulty, putting each vendor in a seperate directory? I guess this is becoming more of a directory structure question. I really want the convenience of SSI's but not at the cost of losing SE ranking. Am I on the wrong track?
Do you feel that since the redirects are server side that they are inconsequencial?
If it were you, would you go ahead and create an index.shtml file for each directory knowing that there is a server side redirect?
I thank you for any opinions
Tom Beach

jdMorgan

9:28 pm on Jul 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Tom,

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

This will tell the server to look for SSI directives and includes in all .htm files... You won't even have to create new .shtml-named pages.

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

Marcia

9:42 pm on Jul 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



As long as PHP pages were brought up - which is not another subject, but a related one regarding this specific issue - what if a person wants to use PHP and just leave the file extensions as .php? In that case, is it necessary to leave the default index page as .htm or .shtml or is there another way around that?

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.

olwen

9:46 pm on Jul 19, 2004 (gmt 0)

10+ Year Member



My host accepts index.php or index.phtml as a default. It's the same issues as using index.shtml

tbeach

10:13 pm on Jul 19, 2004 (gmt 0)

10+ Year Member



<<In the .htaccess file, put this line:

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?

Marcia

10:25 pm on Jul 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It isn't really asking the obvious, because some people mess up on it by putting up the same page with two file extensions (I've seen three - .htm .html and .shtml) - and then mess up by using relative and absolute linking to the homepage inconsistently, even on the same pages. Oh, and with and without the www as well - also on the same pages.

>>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.

jdMorgan

10:35 pm on Jul 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> 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.

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

tbeach

1:13 am on Aug 12, 2004 (gmt 0)

10+ Year Member



Bit of an update: I'm still waiting for my host. They say they allow .htaccess. So I uploaded it with just this line:
AddHandler server-parsed .htm
I tested it and it does not work.
I use ws-ftp for file transfers and the .htaccess is not visible.
They say that it is hidden but it is there and is executable.
After some further reading I found that many say to have this in the .htaccess:
AddType text/html .htm
AddHandler server-parsed .htm

So, I uploaded the new .htaccess with those 2 lines HOPING that it would overwrite the existing.
No way of knowing with it being hidden.

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

jdMorgan

2:29 am on Aug 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> Do I have the contents of the .htaccess file correct?

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

vkaryl

2:45 am on Aug 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Don't know what your host provides as a "control panel" if anything, but the servers I'm on not only show the .htaccess file, they allow editing of it within the cpanel file-manager. The help files do state firmly and without equivocation that you will NOT SEE the .htaccess file if you look at your site layout with a "normal" FTP program (WS_FTP PRO 8 for me....)

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....

tbeach

2:52 am on Aug 12, 2004 (gmt 0)

10+ Year Member



<<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.>>

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

MatthewHSE

6:08 pm on Aug 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In my version of WS_FTP (8.02), I just have to do the following to show hidden files like .htaccess:

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>