Forum Moderators: phranque

Message Too Old, No Replies

.htm pages failure

needs an updated .htaccess file

         

specter

11:56 pm on Jun 9, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello,

I uploaded some . htm web pages on a new server in a dedicated directory but they fail to work.
If I rename them as .html instead,they looks fine.

I'm good reasons to keep my pages as .htm extension, so I'm wondering about a simple .htaccess file to add in that directory allowing to view also .htm files.

As I'm zero about .htaccess, could you please suggest me a proper file?

Thanks in advance

specter

12:12 am on Jun 10, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That's the .htaccess file in the main directory.
I tried to copy it in the new directory but it doesn't work (the subdirectory appears as subdomain like www.sub.mysite.net).
Probably it should be properly edited,but my knowledge as regard is zero...

# -FrontPage-

IndexIgnore .htaccess */.?* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName www.mysite.net
AuthUserFile /home/user/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/user/public_html/_vti_pvt/service.grp
AddType application/x-httpd-cgi .htm
options -Indexes

jdMorgan

12:12 am on Jun 10, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



We need a lot more detail:

Please define "new pages fail to work."

What do you see in your browser?
What do you see in the server error log?
Who configured this server, you or a hosting company?

It is not normal for the server to work with .html but not to work with .htm -- or any other file extension for that matter...

Jim

specter

12:15 am on Jun 10, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Please define "new pages fail to work."

What do you see in your browser?
What do you see in the server error log?

404 error.Page not found.

Who configured this server, you or a hosting company?

The hosting company.

Thanks

jdMorgan

2:42 am on Jun 10, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Still waiting on this one to proceed:\

What do you see in the server error log?

wilderness

4:21 am on Jun 10, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



What do you see in the server error log?

[Sat Jun 9 23:08:56 2007] [error] [client 00.0.00.00] Front Page DUH! ;)

specter

11:35 am on Jun 10, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Where is that error log file located?

specter

12:54 pm on Jun 10, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ok. Found.

I accessed it from my control panel, but there is no error message in the error log folder...

specter

1:41 pm on Jun 10, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



...oops!

Now there is:

Sun Jun 10 08:34:51 2007] [error] [client 80.xx.xx.xx] File does not exist: /home/user/public_html/sub/500.shtml

Hoping it will be helpful.

jdMorgan

3:48 pm on Jun 10, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



OK, that is a compound error; The server encountered a 500-Server Error, and then failed to find the custom error document "/sub/500.shtml", so it reported a 404-Not Found instead of the original 500-Server Error.

Let's back up one step, though... Are you aware that all .htm files are being mapped to the "application/x-httpd-cgi" MIME-type? Did you add this AddType directive to .htaccess, or was it installed by default? If you added it, please explain why. And if not, you might just want to comment it out, flush your browser cache, and re-test.

You will also need to create and upload all custom error documents that you have defined with your control panel. This will fix the second part of the compound error.

I should warn you that 'critical' custom error documents such as those for 500-Server Error, 403-Forbidden, and 404-Not Found should be dirt-simple static documents with no (or very few) external dependencies (i.e. plain HTML with no external file, script, or image includes). Forget "pretty" and "styling" and "branding" -- the error documents are there to help you find problems, not to look good. As demonstrated by this case, problems with custom error documents can mask the 'real' problem, and make even simple problems difficult to find and fix.

Jim

specter

9:06 pm on Jun 10, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I never customized anything.That's a host "performance"...

Anyway, in the considered subdirectory there is no .htaccess file.
I previously tried to copy in it the main directory .htaccess file but nothing happens...
I also tried to upload .htm pages in the main directory, but they again fail...
So there should be something wrong in the .htaccess directives
I already posted that .htacces file content above but you probably missed it.
Here it is:

# -FrontPage-

IndexIgnore .htaccess */.?* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName www.mysite.net
AuthUserFile /home/user/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/user/public_html/_vti_pvt/service.grp
AddType application/x-httpd-cgi .htm
options -Indexes

I tried to comment out the bolded text, nothing happens...

specter

7:18 pm on Jun 12, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ok.Thanks!

I done a search and I found:

I had to add the following mime type:

AddType text/html .html .htm

I'm very surprised that no one of you,"experts",suggested me such a simple solution for my .htaccess file...

I post it for convenience of anybody would come across the same issue.