Welcome to WebmasterWorld Guest from 54.159.30.26

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

.htaccess code

     
12:43 am on May 31, 2005 (gmt 0)

New User

10+ Year Member

joined:Nov 25, 2003
posts:31
votes: 0


I asked a programmer to write a code so .php urls would show as .html this what i now have ( I Have NO Clue about this code ). Sice this code has been up i no longer have visits from the google spider.. i'm still learning so could someone have a quick look and let me know if this code is ok.. thank You

# -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 mysite.com
AuthUserFile /htdocs/meee/mysite.com/_vti_pvt/service.pwd
AuthGroupFile /htdocs/meee/mysite.com/_vti_pvt/service.grp
AddType text/html .shtml
AddHandler server-parsed .html
Options Indexes FollowSymLinks Includes
ErrorDocument 404 [mysite.com...]

12:52 am on May 31, 2005 (gmt 0)

Preferred Member

10+ Year Member

joined:Mar 1, 2005
posts:374
votes: 0


Oh boy, a slightly altered version of the default mod_frontpage .htaccess file! =)

(note: I loathe mod_frontpage.)

This .htaccess file will not treat html files as php files. If you want to do that, you've got a couple of options. The easiest is to find the line in your httpd.conf that reads:


AddType application/x-httpd-php .php

...and change it to read:


AddType application/x-httpd-php .php .html

The downside to this is that /all/ .html files will be parsed by PHP for php code; even .html files that don't have any PHP. This will result in a performance hit; the magnitude will vary from site to site. Probably won't be a huge deal, but be aware of it.

For the record, your programmer has configured Apache to treat .html files as files to search for server-side includes (a.k.a. 'SSI'); this is generally only applied to .shtml files, is also fairly CPU intensive, and (as a result) will result in a performance hit. Unless you have SSI in your .html files, I'd remove the AddType and AddHandler lines from this .htaccess file.