0
我使用CPANEL,有选项Apache处理程序。如何使.php扩展名加载为.html
如何让.php扩展名加载为.html?
例如,
example.com/index.php
应该
example.com/index.html
我使用CPANEL,有选项Apache处理程序。如何使.php扩展名加载为.html
如何让.php扩展名加载为.html?
例如,
example.com/index.php
应该
example.com/index.html
转换PHP扩展使用.htaccess文件为.html在子目录扩展(转换.php为扩展名.html扩展名的所有文件都特定的文件夹使用.htaccess文件)
RewriteEngine on
RewriteBase /subdirectory name
Example
RewriteEngine on
RewriteBase /gallery
RewriteCond %{THE_REQUEST} (.).php
RewriteRule ^(.).php $1.html [R=301,L]
RewriteCond %{THE_REQUEST} (.).html
RewriteRule ^(.).html $1.php [L]
试过,但它说错误404。:( – Fellah 2013-04-24 13:07:48
exa ctly复制提到的代码? 删除图库,因为您没有图库文件夹。改变这个:RewriteEngine on RewriteBase/ – sumon 2013-04-24 13:10:19
是的。没有子目录或/ htdocs的确切代码。错误404。 – Fellah 2013-04-24 13:12:13