Forum Moderators: phranque

Message Too Old, No Replies

No more Foreced parsing!

how to avoid parcing of forced php

         

myny

9:27 pm on Jan 26, 2005 (gmt 0)

10+ Year Member



Ok here's the deal.. i'm battling PHP for the fist time.

On the Apache server v 1.3.26 there is an .htaccss file. its contents are:
------------------------
<Files ayc>
ForceType application/x-httpd-php
</Files>
ErrorDocument 404

/ayc_404.php

-------------------

My problem is that I don't want a forced php extension.
For example, I loaded a .swf and wanted to access it directly: www.mypage.com/ayc/fil.swf, and it gave me the following error:

--------------

Parse error: parse error in /alwaysy/public_html/articles/ayc.swf on line 7

Fatal error: Call to undefined function: head() in /alwaysy/public_html/ayc on line 48
------------------------

Which lead me to believe that it's trying to force an swf file into a php extension.

Tech support told me to remove this line from my .htacces file: "<Files ayc> ForceType application/x-httpd-php </Files>" and that would fix it. But in reality that crashed my entire page and gave me the following error message:

-------------------------------
Not Found
The requested URL /ayc/home/about/index.php was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/1.3.26 Server at www.alwaysyourchoice.com Po
-------------------------------

So after my long long description my goal is to remove the forced .php extension and to be able to access any type file .html .swf .anything without the force :)

I appppplogise in advance if my post sounds newbish.. but well in all honesty .. i am a newb :( :)

Any help would be greatly appreciated!

jdMorgan

11:50 pm on Jan 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



myny,

Welcome to WebmasterWorld!

Instead of using <Files>, use <FilesMatch>.

This will allow you to use regular expressions and to be much more specific about which files the ForceType is to be applied to.

See <FilesMatch> in Apache core documentation.

Jim

myny

1:33 am on Jan 27, 2005 (gmt 0)

10+ Year Member



thanx i'll try that :)

myny

2:06 am on Jan 27, 2005 (gmt 0)

10+ Year Member



man that still did not do the trick :(