Forum Moderators: phranque

Message Too Old, No Replies

500 Error - ForceType application/x-httpd-php

please I need to figure it out, struggling since 1 month..

         

Ali_Roman

3:53 am on Sep 4, 2005 (gmt 0)

10+ Year Member




hey masters..

I have been trying to figure this out since last couple of months, and rightnow after continous try of 11 hours, I am giving it up. please help me why its not working.

I want to make SEF urls by the following method. Here is the code in my .htaccess file.

<Files test>
ForceType application/x-httpd-php
</Files>

I have a file on server called "test" without any extension. When I try to execture this file, it gives me "500 - Internal Server Error". I have seen most of the people are using it, but when I try it does not work. I have also tried the following code in my .htaccess file

<FilesMatch "^test$">
ForceType application/x-httpd-php
</FilesMatch>

the code in my "test" files is
<? echo "this is a test..";?>

but it also gives the same error. I tried AddHandler application/x-httpd-php .ali so if any file thats has .ali extension works fine and executes as .php but why not if there isnt any file extension.

I would be extremely thankful to anyone who can help me figure this out.

thank you.
regards
- Ali..

Ali_Roman

4:34 am on Sep 4, 2005 (gmt 0)

10+ Year Member



believe you me, I have searched this a lot, and asked questions everywhere but no on was there to figure out the problem. I asked my hosting comapany, and they also seem to be novice, they asked lame questions in counter.

I have found a solution, and I am sure this will help most of people, because I see everywhere people have the same problem but there isnt any answer to this.

here is the code to use in your .htacces file..

AddHandler server-parsed .php
<Files ~ "^[^\.]+$">
SetHandler application/x-httpd-php
</Files>
AddHandler application/x-httpd-php .php

I know nothing about nature of apache, but it worked for me, and I am sure it will work for any others as well.

cheers
- Ali :)

[edited by: jdMorgan at 1:42 pm (utc) on Sep. 4, 2005]
[edit reason] Removed URL per TOS. [/edit]

Span

9:51 am on Sep 4, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is another way:

RewriteEngine On
RewriteRule ^[^.]+$ - [T=application/x-httpd-php,L]