Portal Home > Knowledgebase > Articles Database > mime / php question


mime / php question




Posted by Calibaba, 03-13-2008, 09:37 PM
I have a domain that is bringing 500 error on the below htaccess rules If I remove this line, it fixes the 500 error, yet I cannot use php within html RewriteRule ^.* - [F,L]AddHandler application/x-httpd-php .html .htm The server is on php 5.2.5 with apache 2 (cpanel with suphp) Apache error logs: [Thu Mar 13 17:10:54 2008] [alert] [client xxxxx] /home/user/public_html/.htaccess: RewriteCond: bad flag delimiters, referer: http://domain.com/editor/wp-admin/ Last edited by Calibaba; 03-13-2008 at 09:41 PM.

Posted by foobic, 03-13-2008, 11:09 PM
That's not one line - it's two:

Posted by Calibaba, 03-13-2008, 11:11 PM
What do you mean? It *should* be one line or two?

Posted by zacharooni, 03-13-2008, 11:11 PM
It IS two lines.

Posted by Calibaba, 03-14-2008, 01:09 AM
Something is not right. PHP is not parsing in html RemoveHandler .html .htm AddType application/x-httpd-php .php .htm .html That is what I have in the htaccess file now and this causes the domain to popup save file prompt. If I remove that, the domain shows up, yet without parsing php within html I have tried numerous adjustments, including the following: -Add server-parsed .html to Apache Handlers -Add application/x-httpd-php .html to MIME Types -Attempt both of the above via the .htaccess file rather than cpanel -Rewrite .htacess to only read "RewriteRule ^.* - [F,L] AddHandler application/x-httpd-php .html" -Rewrite .htaccess to only read "AddHandler application/x-httpd-php .html .php. htm"

Posted by david510, 03-14-2008, 04:13 AM
Make sure there is no "AllowOverride none" set for the VH in the main httpd.conf file.

Posted by applicurearun, 03-17-2008, 10:25 AM
can we have your php.ini details?

Posted by thegee, 04-13-2008, 01:36 PM
It's most likely the host. I have tried to move my sites to two other hosting companies only to find that they are not configured correctly. Now I know when I sign up I move over a site that I know will need html files that have php embedded to see if they work or not. I have numerous sites that scrape rss feeds by using php scripts and when i first tried another host and my sites didn't work I was frustrated to the hilt with numerous support tickets and the like. It seems no one has a clue with what you are asking or talking about. So after hours of trying numerous scripts and changing the htaccess file to every which way and munerous support tickets I finally found a few (and I do mean few) posts across the web with the same problem. The bottom line was the host not being configured for it. The host I am with now has absolutely no problem parsing php in html files (downtime is the reason for looking for another). So my advice when looking for a new host is one with a money-back guarantee and move the one site over parses php from html files and see if it works. If not move on or go ahead and knock yourself out and waste alot of time.

Posted by Steve_Arm, 04-13-2008, 01:44 PM
Change to this: RewriteRule ^(.*) - [F,L]

Posted by thegee, 04-13-2008, 01:53 PM
Tried that. http://www.nashvilleconcerts.com/index.html and http://www.nashvilleconcerts.com/index.php Same files, different extensions. (nameservers have been updated so might not work after awhile) http://www.losangelesconcerts.com/ works fine like the rest of my sites with same set up. Last edited by thegee; 04-13-2008 at 01:56 PM.

Posted by Metallian, 04-13-2008, 11:28 PM
or try this ForceType application/x-httpd-php

Posted by thegee, 04-14-2008, 12:13 AM
Well, after 4 days going back and forth with a host I was trying out they came up with the solution minutes after I decided to cancel (wonder why?). With all the searching on the internet I came up with everything listed here and elsewhere but this: AddHandler application/x-httpd-php5 .html Looks too basic but why no one else came up with this? Even the other host I'm trying after 3 days so far had no answers but as soon as I added this to the test site at that host it worked. We'll see as I test it some more but looks good...finally.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
BitNinja (Views: 538)
shorten mysql select (Views: 507)