Apache Server configuration support - .htaccess route to php on .html

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > September 2007 > .htaccess route to php on .html





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author .htaccess route to php on .html
dorayme

2007-09-05, 1:26 am

I made an .htaccess file to allow my .html files to be parsed for
any php on them. It has:

AddType application/x-httpd-php .html

It did not work on one server (a university server that is Apache
and Unix and all that good old stuff, nothing Windows or funny
stuff). Before I contact server admin, any other ways to
accomplish getting a .html file to be so parsed? If I name my
files .php on this particular server, all work fine. I can put
the .htaccess file simply at the top level of my website or one
level above (where I see no *other* files, no permission
probably).

I have no real idea about this stuff, but I love it
when it works. <g>

Please, I want my html files to be checked for php on them. I
have no access to anything on the server except my own files. I
suspect I have to contact server admin, they may be blocking such
things. I might, reluctantly, have to use .php (which works a
treat straight away with no need for anything beyond the php on
the page)

--
dorayme
shimmyshack

2007-09-05, 7:36 pm

On Sep 5, 2:16 am, dorayme <doraymeRidT...@optusnet.com.au> wrote:
> I made an .htaccess file to allow my .html files to be parsed for
> any php on them. It has:
>
> AddType application/x-httpd-php .html
>
> It did not work on one server (a university server that is Apache
> and Unix and all that good old stuff, nothing Windows or funny
> stuff). Before I contact server admin, any other ways to
> accomplish getting a .html file to be so parsed? If I name my
> files .php on this particular server, all work fine. I can put
> the .htaccess file simply at the top level of my website or one
> level above (where I see no *other* files, no permission
> probably).
>
> I have no real idea about this stuff, but I love it
> when it works. <g>
>
> Please, I want my html files to be checked for php on them. I
> have no access to anything on the server except my own files. I
> suspect I have to contact server admin, they may be blocking such
> things. I might, reluctantly, have to use .php (which works a
> treat straight away with no need for anything beyond the php on
> the page)
>
> --
> dorayme


you could carry on writing .php files but rewrite anything ending
in .html to the corresponding php file you have
so say you create three files
howdeedoodee.php
noidontee.php
and
whatamacallit.php

then you write yuor webpages pointing to
howdeedoodee.html
noidontee.html
and
whatamacallit.html

then use a rewrite - providing they are switched on
#might need to turn it on
#ReWriteEngine On
ReWriteRule (.*)\.html?$ $1.php [L]
that oughta do it. (works for .htm files as well as .html - not the
html? in the rule)

dorayme

2007-09-06, 1:36 am

In article
<1189031391.858824.289760@d55g2000hsg.googlegroups.com>,
shimmyshack <matt.farey@gmail.com> wrote:

> On Sep 5, 2:16 am, dorayme <doraymeRidT...@optusnet.com.au> wrote:
>
> you could carry on writing .php files but rewrite anything ending
> in .html to the corresponding php file you have
> so say you create three files
> howdeedoodee.php
> noidontee.php
> and
> whatamacallit.php
>
> then you write yuor webpages pointing to
> howdeedoodee.html
> noidontee.html
> and
> whatamacallit.html
>
> then use a rewrite - providing they are switched on
> #might need to turn it on
> #ReWriteEngine On
> ReWriteRule (.*)\.html?$ $1.php [L]
> that oughta do it. (works for .htm files as well as .html - not the
> html? in the rule)


Interesting idea! But it feels a bit desperate <g>. My thoughts
are turning to simple renaming everything but the index page with
..php endings... It sure looks like server admin are blocking my
attempts to parse .html for php.

--
dorayme
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com