应该可以做到吧,http://www.xxx.com/1.php 这样访问就调用Templates下1.htm
当访问http://www.xxx.com/2.php 就调用Templates下2.htm 自己写Apache rewrite规则应该可以实现。至于1.htm 2.htm里有些代码还需要php程序处理. 可以配置apache的httpd.conf,在里面加入下面这行代码:AddType aaalication/x-httpd-php .htm
当访问http://www.xxx.com/2.php 就调用Templates下2.htm 自己写Apache rewrite规则应该可以实现。至于1.htm 2.htm里有些代码还需要php程序处理. 可以配置apache的httpd.conf,在里面加入下面这行代码:AddType aaalication/x-httpd-php .htm
AddType application/x-httpd-php .htm
htm这也页面可以可以使用smarty啊!
AddType application/x-httpd-php .htm谢谢指正。rewrite规则如下:<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ([0-9]{1,})\.php$ /Templates/$1.html
</IfModule>将上面的内容保存为.htaccess文件放在网站根目录即可。
P.S. Django里说了把.php用Rewrite来指向python是变态行为...
用Rewrite把所有的请求都抛向index.php[code=BatchFile]RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L][/code]
如果是楼主所讲的那样有规则的,我觉得没有必要。index.php多去处理一次,比较麻烦。
rewriterule ^([1-9]+)\.php$ handler.php?page=$1handler.php
require("{$_GET['page']}.html");简单吧..
这种做法让我感觉是把Word文件的后缀改成了xls一样……