Forum Moderators: phranque

Message Too Old, No Replies

Apache SSI with Rewrite rules from .htm to .php

Is it possible to configure a virtual include to execute .php files

         

theh1982

12:47 pm on Aug 3, 2011 (gmt 0)

10+ Year Member



Hi All,


I have a webpage called index.htm

within the webpage it pulls a number of elements using SSI.


For example:

<!--#include virtual="/include/default/common/template/head.htm" --> 



<!--#include virtual="/include/default/common/template/header.htm" -->


Now I want to actually pull in .php pages but I cannot change the original index.htm to facilitate that so I want a rewrite rule that would

Fore example
/include/default/common/template/head.htm ReWrite to /include/default/common/template/head.php 


and

/include/default/common/template/header.htm ReWrite to /include/default/common/template/header.php 



Is this possible within Apache2 SSI with Rewrite rules ?

theh1982

9:56 am on Aug 4, 2011 (gmt 0)

10+ Year Member



Bump

g1smd

7:10 pm on Aug 4, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



It is not possible, because rules in .htaccess work only on incoming URL requests.

Your "includes" are internal file-system path requests, not external URL requests.