Web Hosting Talk







View Full Version : .HTACCESS questions


certify
06-23-2001, 06:12 AM
Because SSI only works with .SHTML extention by default and if you want SSI to work with .HTM or .HTML extention you have to do this in (below) .HTACCESS, right. I tried to place .PL or .CGI extention but it won't work.

I have added the line into my .HTACCESS but instead when I execute my CGI files I got an 403 Error??


AddHandler cgi-script .cgi

(SH)Saeed
06-23-2001, 06:33 AM
Don't you already have AddHandler cgi-script .cgi in your httpd.conf file?

Eagle_
06-23-2001, 09:31 AM
add this in your httpd.conf
and restart apache

AddHandler server-parsed .shtml .html .htm

griffjon
06-23-2001, 02:29 PM
There are a lot of reasons you might be getting a 403. Generally, 403 means the permissions for the file aren't set correctly--scripts generally need read and excute permissions. If you have telnet access, you can fix this with chmod, by typing chmod a+rx scriptname.cgi . This means that anyone can read and execute the script. You should read up on chmod before going too wild with it, as it can introduce vast security holes.

Other things you want to check--is it in your cgi-bin directory? Does the script access a file that is not correctly permissioned (read, write)? Is the directory properly permissioned? (read, execute)

.pl and .cgi are almost certainly preconfigured (but follow the others' suggestions for dealing with httpd.conf if not), and adding them to .htaccess will only confuse things.

500 usually indicates that something's fubared with the script or server, 403 almost always means you haven't dotted your 'i's and crossed your 't's in permissions.

certify
07-06-2001, 05:24 AM
Originally posted by zolbian
Don't you already have AddHandler cgi-script .cgi in your httpd.conf file?

Where can I find the httpd.conf ?

It is at /etc/httpd/conf

Chicken
07-07-2001, 12:44 AM
Originally posted by Eagle_
add this in your httpd.conf
and restart apache

AddHandler server-parsed .shtml .html .htm

I'd add this to your .htaccess file and upload it to the directory in which you want the server to parse html files and not to the httpd.conf file as this would tell the server to parse all html files served (server-wide).