开发者

lighttpd and fastcgi.map-extension detection / content negotiation on rewritten "clean" URLs with no file extensions?

My current website uses PHP to build and output HTML content to the browser specified by rewritten "clean" urls.

url.rewrite-once = (
"^/([-a-zA-Z0-9]+)/$" => "/index.php?section=$1",
"^/([-a-zA-Z0-9/]+)/([-a-zA-Z0-9/]+)$" => "/index.php?section=$1&article=$2" 
)

index.php simply calls my functions to build and output content depending on the variables:

http://domain.com/some-section/this-is-an-article/

At present this is just flat HTML output, but I am wanting to now in the flat output include PHP, mainly for PHP include calls when the page is loaded in the browser:

<h1>lorem ipsum</h1>
<?php include_once('example.php') ;?>
<p>Dolar sit amet.</p>

I simply thought I could map HTML through php as such:

fastcgi.map-extensions = ( ".html" => ".php" )

But because my URLs do not physically have file extensions and nor does any physical rewritten page with extension actually exist, fastcgi cannot map anything.

I have tested that fastcgi works by simply creating a .html file with embedded PHP and it is parsed correctly, so I know .html file extensions are being mapped through fastcgi.

My question is simply (or not so) how would one get fastcgi/lighttpd to map my outputted content through PHP开发者_Go百科 if it does not have an extension?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜