rewrite rule .php to show .html in url add errordocument 404 not work

Viewed 23

I have in my FTP Folder only .php files like test.php and show the files in Browser with test.html

RewriteCond %{THE_REQUEST} (.*)\.php  
RewriteRule ^(.*)\.php $1.html [R=301,L]  

RewriteCond %{THE_REQUEST} (.*)\.html  
RewriteRule ^(.*)\.html$ $1.php [L] 

When i now add ErrorDocument 404

ErrorDocument 404 /404.php

its shows error document right on /test /test.htm

but not in filenotexist.html (all files with .html that not exists on server)

it only stands in the browser: File not found. this is because of the rewriterule. Has anybody a solution for this ?

0 Answers
Related