I rewrite my .php files to .htm, using the following code in .htaccess file.
RewriteEngine on
Options +FollowSymlinks
RewriteRule ^(.+)\.htm$ $1.php [NC]
This is working fine. But now I want to restrict access of .php file directly.
As example: when people request index.htm he can see the content of index.php file, but if he request index.php then he will get an 404 error. How is it possible?