ForceType application<

liunx

Guest
is there something in apache I need to turn on for this to work?

<!-- w --><a class="postlink" href="http://www.site.com/code/6">www.site.com/code/6</a><!-- w -->

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

and I want code to be run as php. I tried it and it tells me that the file has been perminately moved.>> is there something in apache I need to turn on for this to work?

>> <!-- w --><a class="postlink" href="http://www.site.com/code/6">www.site.com/code/6</a><!-- w -->


Make what work?

Do you mean "access pages with /code/6/ instead of using the old ?param=code&site=6 method"?

If so, then you are looking at Mod_Rewrite to do this.not according to this site

<!-- m --><a class="postlink" href="http://www.sitepoint.com/article/485/3">http://www.sitepoint.com/article/485/3</a><!-- m -->

also I want "code" to be executed as php anytime it is in the url.

yes it is working as this

/code/6 and the translates to code.php?id=6 and you don't need mod-rewrite to do itive always used mod_rewrite to do it, also
<!-- m --><a class="postlink" href="http://www.phpfreaks.com/tutorials/23/0.phpno">http://www.phpfreaks.com/tutorials/23/0.phpno</a><!-- m --> there is another way.

I can't use mod-rewrite as it would mess up the urls I have now and they work as long as I have a .php in them. using forceType you can make even a image run as php, but ther eis something stopping it on my server.

actually I have a different error as I forgot somethign on that forcetype

ForceType application/x-httpd-php .phpjust put it in .htaccess!that is where it is at.i just try and the file wasn't parse and subfolder not found because i had
AllowOverride None
in my <Directory>
of my httpd.conf

i put
AllowOverride All
and it's now working!

and i didn't put .php at the end of the forcetypeit just gave me the Download box.you need mod_mimein the htaccess file? do you have an example?it is already loaded.

LoadModule mime_module modules/mod_mime.so

it is not commented outwell i don't know
maybe try instead of .htaccess, adding
<Location /code>
ForceType application/x-httpd-php
</Location>
to your httpd.confwell if it has to go this extreme than I can't do it. I don't have control over my conf file on my host.

guess I can't do it. oh well I will just add a .php in the url and it works fine, I was just trying to get rid of the .php.how could it give a Download box for a text file! very strange like if php wasn't configure in apache.

the only way i can imagine, is forcetype doesn't match the addtype...php runs fine on my localhost. and the only difference between the addtype and forcetype is the .phpare you running php as a module?
anything in your error log?actually I am not sure. been a long time since I looked at it but I am going to say no. I know on my host they are not, it is cgi modeseems like it's not working for cgi mode on windows platform...my host is cgi mode on linux, might be the same as it doesn't work.or they have safe-mode=onnope, safe-mode is not onHey mate,

I know exactly what the prob is here. You need to edit the line in the httpd.conf file that reads:

AllowOverride None

and make it read:

AllowOverride FileInfo

Hey presto, your problems will disappear :). Oh, btw, the application will not pass the arguments to a var called 'id' you will have to extract them by exploding the $_SERVER['PATH_INFO'] var. The arguments will start at array offset 1 (0 contains the filename)Originally posted by torrent
Hey mate,

I know exactly what the prob is here. You need to edit the line in the httpd.conf file that reads:

AllowOverride None

and make it read:

AllowOverride FileInfo

Hey presto, your problems will disappear :).
I can't edit it on the host

Originally posted by torrent
Oh, btw, the application will not pass the arguments to a var called 'id' you will have to extract them by exploding the $_SERVER['PATH_INFO'] var. The arguments will start at array offset 1 (0 contains the filename)
I already do that ;)If you can't edit it then I'm afraid it's a no-go for you as the AllowOverride directive can't be set within .htaccess.

You could try looking at the mod-rewrite route but frankly it's more trouble than it's worth in my book.yup, it sure is.

I just wanted to get the .php out of the url, but I can live with it if I can't. :)

thanks bud
 
Back
Top