我有5个使用相同编码模板的WordPress站点。该编码模板(我无法更改)使用一些基本的html布局代码调用名为“2012.orange.html”的文件。我在我的服务器的“/ home /”目录中创建了一个“my_template.php”,而在我的模板目录中的另一个“2012_orange.php”文件中,“/ home /”包含了“my_template.php”。使用.htaccess将.html重定向到.php
我的目标是用于“/ home /”目录中的“my_template.php”文件来控制5个不同站点的布局,但我无法弄清楚如何获取特定的.html文件文件来代替调用.php文件。
我做了我的“robots.txt”类似的东西使用下面的代码,它工作得很好:
# BEGIN - Robots Rewrite
RewriteEngine on
RewriteRule ^robots\.txt$ robots.php [L]
## END - Robots Rewrite
但我不能得到这个工作...我没有得到HTML布局:
# BEGIN - Template Rewrite
RewriteEngine on
RewriteRule ^2012\.orange\.html$ 2012_orange.php [L]
## END - Template Rewrite
再然后,将2012_orange.php将只包含以下内容包括:
<?php include ('/home/my_template.php'); ?>
的当想要调用原始的.html文件时,如何让.htaccess重定向到文件的.php版本?