|
|
| Matthew256 2006-10-30, 7:04 pm |
| I have a bunch of files with the extension .cfm with PHP code in them.
It's a long story, but I need to keep the extension the same.
Is there a way to make PHP parse the .cfm file?
My web host says they can't do it on their end.
Should I argue?
Matthew
| |
| Jerry Stuckle 2006-10-30, 7:04 pm |
| Matthew256 wrote:
> I have a bunch of files with the extension .cfm with PHP code in them.
> It's a long story, but I need to keep the extension the same.
> Is there a way to make PHP parse the .cfm file?
> My web host says they can't do it on their end.
> Should I argue?
>
> Matthew
>
I can't say as I blame them. I wouldn't want to try adding non-standard
extensions like this for every client.
If this is Apache, they could with an AddType directive in the
httpd.conf file. You could do it in the .htaccess file.
But .cfm is a Cold Fusion template file. Why would you have php code in it?
You'll be much better off in the long run if you change the extension to
something standard like .php. Or just get yourself a virtual private
server where you can do anything you want.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
| |
| Pedro Graca 2006-10-30, 7:04 pm |
| Matthew256 wrote:
> I have a bunch of files with the extension .cfm with PHP code in them.
> It's a long story, but I need to keep the extension the same.
> Is there a way to make PHP parse the .cfm file?
PHP doesn't care about extensions.
fopen(), fread(), and fclose() come to mind.
If the .cfm is plain text I'd use file() instead.
--
I (almost) never check the dodgeit address.
If you *really* need to mail me, use the address in the Reply-To
header with a message in *plain* *text* *without* *attachments*.
| |
| Joel Parish 2006-10-30, 7:04 pm |
| Add the following line to the .htaccess file in the directory (If there
is one, if not create it)
AddType application/x-httpd-php .php .cfm #add any other extentions
you want to be parsed
Hope this helps,
--Joel
On Oct 29, 1:53 pm, "Matthew256" <PRESENT...@gmail.com> wrote:
> I have a bunch of files with the extension .cfm with PHP code in them.
> It's a long story, but I need to keep the extension the same.
> Is there a way to make PHP parse the .cfm file?
> My web host says they can't do it on their end.
> Should I argue?
>
> Matthew
| |
| Chung Leong 2006-10-30, 7:04 pm |
| Jerry Stuckle wrote:
>
> But .cfm is a Cold Fusion template file. Why would you have php code in it?
>
> You'll be much better off in the long run if you change the extension to
> something standard like .php. Or just get yourself a virtual private
> server where you can do anything you want.
My guess is that the OP needs to preserve the URLs in existing links.
This is probably better handled through apache rewrite than changing
the file extension of the source files.
| |
| Jerry Stuckle 2006-10-30, 7:04 pm |
| Chung Leong wrote:
> Jerry Stuckle wrote:
>
>
>
> My guess is that the OP needs to preserve the URLs in existing links.
> This is probably better handled through apache rewrite than changing
> the file extension of the source files.
>
A 301 redirect takes care of things quite nicely - and permanently.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
| |
| Chung Leong 2006-10-30, 7:05 pm |
|
Jerry Stuckle wrote:
> Chung Leong wrote:
>
> A 301 redirect takes care of things quite nicely - and permanently.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstucklex@attglobal.net
> ==================
One would use rewrite to do that, naturally.
| |
|
| Matthew256 wrote:
>
> I have a bunch of files with the extension .cfm with PHP code in them.
> It's a long story, but I need to keep the extension the same.
> Is there a way to make PHP parse the .cfm file?
Yes. You can add an AddType directive to httpd.conf.
> My web host says they can't do it on their end.
What they mean to say is that they don't WANT to do it. It requires
changing apache configuration file, which is against policy in many
Web hosting companies.
> Should I argue?
You can argue, but it is probably going to be futile.
Cheers,
NC
| |
| Jerry Stuckle 2006-10-30, 7:05 pm |
| Chung Leong wrote:
> Jerry Stuckle wrote:
>
>
>
> One would use rewrite to do that, naturally.
>
You can use a rewrite. But a redirect will allow the search engines to
pick up the change without affecting current page rank. So eventually
you can get rid of your redirects.
If you just do a rewrite no one will know it's actually changed.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
| |
| Chung Leong 2006-10-30, 7:05 pm |
|
Jerry Stuckle wrote:
> Chung Leong wrote:
>
> You can use a rewrite. But a redirect will allow the search engines to
> pick up the change without affecting current page rank. So eventually
> you can get rid of your redirects.
The easiest way to perform the redirection is with a rewrite rule, with
the R=301 flag.
See http://httpd.apache.org/docs/2.0/mo...tml#rewriterule
| |
| Jerry Stuckle 2006-10-30, 7:05 pm |
| Chung Leong wrote:
> Jerry Stuckle wrote:
>
>
>
> The easiest way to perform the redirection is with a rewrite rule, with
> the R=301 flag.
>
> See http://httpd.apache.org/docs/2.0/mo...tml#rewriterule
>
True. You can use a rewrite to do a 301 redirect.
But not all rewrites are 301 redirects. A key point here.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
| |
| Matthew256 2006-10-31, 6:59 pm |
| I've heard that Google looks at a 301 redirect as the same as a link
from the .cfm page to the .php page.
Is this correct?
Matthew
On Oct 30, 1:48 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> Chung Leong wrote:
>
>
>
>
>
>
>
>
> pick up the change without affecting current page rank. So eventually
> you can get rid of your redirects.
>
> If you just do a rewrite no one will know it's actually changed.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================
| |
| Matthew256 2006-10-31, 6:59 pm |
| I've created the .htaccess file in my root directory.
However, this doesn't seem to work properly:
http://209.200.94.91/default.cfm
Matthew
On Oct 29, 7:14 pm, "Joel Parish" <joel.par...@gmail.com> wrote:[color=darkred]
> Add the following line to the .htaccess file in the directory (If there
> is one, if not create it)
>
> AddType application/x-httpd-php .php .cfm #add any other extentions
> you want to be parsed
>
> Hope this helps,
> --Joel
> On Oct 29, 1:53 pm, "Matthew256" <PRESENT...@gmail.com> wrote:
>
>
| |
| Jerry Stuckle 2006-10-31, 6:59 pm |
| Matthew256 wrote:
> I've heard that Google looks at a 301 redirect as the same as a link
> from the .cfm page to the .php page.
> Is this correct?
>
> Matthew
>
> On Oct 30, 1:48 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
>
>
>
No. 301 is a permanent redirect. Google effectively replaces the page.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
|
|
|
|