Forum Moderators: phranque
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
# -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
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
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
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...