I want to rewrite my url from php extention to html.and if that file was not found then it should redirect to some custome page(404.php).
I have written rule like this:
RewriteEngine on
RewriteRule ^$ front/index.php?query=$1 [NC,L,QSA]
RewriteRule (.*)\.(html) ?page=$1 [L,NC,QSA]
ErrorDocument 404 /expertLocal/?page=404
using this i am facing problem like this. http://somedomain.com/expertLocal/contact.html
it will work file coz i have contact.php page . if i will write somedomain.com/expertLocal/contactxyz.php then it redirect to 404.php page but if i will write http://somedomain.com/expertLocal/contactxyz.html in address bar then it will give warnings instead of 404.php page.
This is because i ahve used my own framework and in this structure file is first redirect to controller index file and then included requested file there.
include(FRONT_CONTROLLER_PATH . $page . '.php'); like this.
Can you please help me out?
Thanks in advance..