2013-04-24 41 views

回答

0

转换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] 
+0

试过,但它说错误404。:( – Fellah 2013-04-24 13:07:48

+0

exa ctly复制提到的代码? 删除图库,因为您没有图库文件夹。改变这个:RewriteEngine on RewriteBase/ – sumon 2013-04-24 13:10:19

+0

是的。没有子目录或/ htdocs的确切代码。错误404。 – Fellah 2013-04-24 13:12:13