PHP5 issue


#1

My account was just switched to php5-cgi, and my .htaccess file has: AddType php5-cgi .shtml .htm .html.

All of my webpages are in HTML 4.01 transitional. Since the switch, many users cannot load my site. When I validate my site, it says these two (HTML 4.01 and php5-cgi) are contradictory. So what do I do? It’s my understanding I cannot revert to php4. Do I have to code everything in XHTML!?

Thank you for any help.

John


#2

Remove the lines:

AddType php5-cgi …
AddHandler php5-cgi …

Those two lines that were an attempt to tell the web server to treat .htm, .html and .shtml as if they were PHP scripts.

So if they are not actually PHP scripts, remove both of those lines. Once you have done so:

.php files will run PHP 5 as CGI (no SSI!)
.htm, .html will be plain HTML documents (no PHP code or SSI)
.shtml will be HTML documents parsed for SSI (no PHP code)

Which is the default setup. You have not provided enough information to determine if you need something different.

:cool: openvein.org -//-


#3

Thank you very much. I removed those lines and it all seems to be working.

How do I know what my default is? What you described is what I need

.php files will run PHP 5 as CGI (no SSI!) – I have no PHP filed
.htm, .html will be plain HTML documents (no PHP code or SSI) – That’s what I need
.shtml will be HTML documents parsed for SSI (no PHP code) – That’s what I need.

What do I owe ya?

John


#4

What I described is how all customers websites are setup to work at first. However it can be changed in the .htaccess and whether or not it needs to be changed really depends on your web site. I don’t know why the support person made that change because usually that type of change is made to make PHP scripts look like they are not PHP scripts to your visitors (e.g. not wanting to redirect outdated URLs to new URLs). I get the idea that that is not the case for your web site and anyone making that change would have had to inspect the content of your files to ensure it was necessary. Also using AddType is the wrong way to make that change too.

:cool: openvein.org -//-