只是想知道通过.htaccess重命名.php文件.html文件是否会有任何问题?我们现有的网站是html,我想用动态php页面更新页面,但人们已经保存了到现有html网站的链接。如果这不可能,我用iframe创建html页面以包装php页面的唯一方法是什么?
谢谢:)
它不是将php文件重命名为html,而是使用html扩展名将文件重定向到php文件。
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f # don't apply to the existing html files
RewriteRule ^([^.]+)'.html$ /$1'.php [QSA,L] # QSA means combine query string.
我相信
RewriteEngine on
RewriteRule ^(.*)'.html $1'.php
应该能满足您的需求(未经测试)