.htaccess route to php on .html
.htaccess route to php on .html
am 05.09.2007 03:16:08 von dorayme
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.
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
Re: .htaccess route to php on .html
am 06.09.2007 00:29:51 von shimmyshack
On Sep 5, 2:16 am, dorayme 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.
>
> 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)
Re: .htaccess route to php on .html
am 06.09.2007 03:46:14 von dorayme
In article
<1189031391.858824.289760@d55g2000hsg.googlegroups.com>,
shimmyshack wrote:
> On Sep 5, 2:16 am, dorayme 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.
> >
> > 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)
Interesting idea! But it feels a bit desperate . 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