How to remove index.php from home page URL
example.com/index.php
to
example.com
and
example.com/directory/index.php
to
example.com/directory
I read many posts on stackoverflow and when I’m using those codes then if I go to an invalid URL (like – example.com/ahjgbhjkllghfd) then it will not showing 404 response. it shows response 200 and main page content on the invalid URL.
{ sorry for bad English 🙂 }
2
Answers
Could you please try following, have written on mobile couldn’t test it should work I believe.
If you need 404 error response then try adding ErrorDocument line
It will show
/error.php
file when/ahjgbhjkllghfd
is accessed.All together might be this