2012-07-12 63 views
1

我試圖將所有.php文件與HTML擴展運行,但它給了我404 Page Not found error重定向.PHP到HTML擴展404錯誤

如果我運行PHP擴展的文件,它運行良好但沒有.html擴展名,我也檢查了mod_rewrite is enabled

我正在安裝Ubuntu 12版本和PHP 5.3。

htaccess的代碼如下:

AddHandler application/x-httpd-php .php .html 
AddType application/x-httpd-php .html 
Options +FollowSymLinks 
RewriteEngine on 
RewriteBase/
RewriteRule ^(.*)\.html$ $1.php [L] 
#RewriteCond %{REQUEST_URI} ^(.*)\.php$ 
#RewriteRule ^(.*) /$1.html [R=301,L] 

請幫助我,什麼是錯?

謝謝!

回答

1

它適用於:

RewriteEngine On 
RewriteRule ^(.*)\.html$ $1.php [L] 
+1

呀,你不需要任何添加的其他代碼。 – deefour 2012-07-12 13:45:53